Question Detail

How to use VectorDrawableCompat from the AppCompat library?

6 years ago Views 1445 Visit Post Reply

Initially, when minsdkversion was set to 21 in manifest, I used android:src="@drawable/vector_icon" to set the vector graphic as the source of the image in ImageView. This worked fine.
I have updated its version after that it's giving me this error how to correct it?


Thread Reply

Nick Johnson

- 6 years ago

android {
  defaultConfig {
    vectorDrawables.useSupportLibrary = true
  }
}
??????Use this it will help you

Anonymous

- 6 years ago

find   vectorDrawables.useSupportLibrary = true  in your gradle file and remove it and use as default.

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_activity"
    />

Anonymous

- 6 years ago

Just Remove this line from your Gradle File

vectorDrawables.useSupportLibrary = true