title: Using android vector Drawables on pre Lollipop crash
body: <p>I'm using vector drawables in android <strong>prior to Lollipop</strong> and these are of some of my libraries and tool versions:</p>
  
  <ul>
  <li>Android Studio : 2.0 </li>
  <li>Android Gradle Plugin : 2.0.0 </li>
  <li>Build Tools : 23.0.2 </li>
  <li>Android Support Library : 23.3.0</li>
  </ul>
  
  <p>I added this property in my app level <code>Build.Gradle</code></p>
  
  <pre><code>android {  
    defaultConfig {  
      vectorDrawables.useSupportLibrary = true  
     }  
  }
  </code></pre>
  
  <p>It is also worth mentioning that I use an extra drawable such as LayerDrawable(layer_list) as stated in Android official Blog (<a href="http://android-developers.blogspot.co.uk/2016/02/android-support-library-232.html" rel="noreferrer">link here</a>) for setting drawables for vector drawables outside of <code>app:srcCompat</code></p>
  
  <pre><code>&lt;level-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@drawable/search"/&gt;
  &lt;/level-list&gt;
  </code></pre>
  
  <blockquote>
    <p>You’ll find directly referencing vector drawables outside of
    app:srcCompat will fail prior to Lollipop. However, AppCompat does
    support loading vector drawables when they are referenced in another
    drawable container such as a StateListDrawable, InsetDrawable,
    LayerDrawable, LevelListDrawable, and RotateDrawable. By using this
    <strong>indirection</strong>, you can use vector drawables in cases such as TextView’s
    android:drawableLeft attribute, which wouldn’t normally be able to
    support vector drawables.</p>
  </blockquote>
  
  <p>When I'm using <code>app:srcCompat</code> everything works fine, but when I use:</p>
  
  <pre><code>android:background
  android:drawableLeft
  android:drawableRight
  android:drawableTop
  android:drawableBottom
  </code></pre>
  
  <p>on <code>ImageView</code>, <code>ImageButton</code>, <code>TextView</code> or <code>EditText</code> prior to Lollipop, it throws an expection: </p>
  
  <pre><code>Caused by: android.content.res.Resources$NotFoundException: File res/drawable/search_toggle.xml from drawable resource ID #0x7f0200a9
  </code></pre>