Vector drawables on pre-lollipop devices not working

Viewed 1114

REFERENCE: http://android-developers.blogspot.in/2016/02/android-support-library-232.html

Using this official android developer's blog,I have coded for vector drawables for my app.
Code is working fine with lollipop devices,but not with pre-lolipop devices.

I have the following dependencies in my gradle -

com.android.support:support-vector-drawable:23.2.0
com.android.support:appcompat-v7:23.2.0

My gradle version is 2.0.0-beta5, so as per the blog I added

// Gradle Plugin 2.0+ 
    android {  
       defaultConfig {  
         vectorDrawables.useSupportLibrary = true  
        }  
     }

When I use android:src for ImageView,it works with lollipop devices. But app crashes for pre-lolipop devices with android.view.InflateException.

and as per the blog I am trying to use app:srcCompat for ImageView,I am getting a compile time error - unexpected namespace prefix app, though I have specified namespace app as xmlns:app="http://schemas.android.com/apk/res-auto" in my layout.

1 Answers
Related