title: Change android colorPrimary (app bar) to gradient color
body: <p>I need to change color on my application bar to some gradient color. I created action_bar_bg.xml file in drawable folder: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;gradient
          android:angle="90"
          android:centerColor="@color/colorPrimaryDark"
          android:endColor="@color/colorPrimary"
          android:startColor="@color/colorPrimary" /&gt;
  &lt;/shape&gt;
  </code></pre>
  
  <p>and I tried to change colorPrimary in styles.xml:</p>
  
  <pre><code>&lt;!-- Base application theme. --&gt;
  &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;!-- Customize your theme here. --&gt;
  
      &lt;item name="colorPrimary"&gt;@drawable/action_bar_bg&lt;/item&gt;
  
  &lt;/style&gt;
  </code></pre>
  
  <p>but it doesn't work. I am getting error: <code>android.content.res.Resources$NotFoundException: File res/drawable/action_bar_bg.xml from color state list resource ID #0x7f020046)</code>
  I want to achieve that result:<br>
  <img src="https://i.stack.imgur.com/o2Lva.png" alt="app bar with gradient"></p>
  
  <p>What do I have to change in code?</p>