0

I was used vectorDrawable image . The app is crash on API level 23 and getting the error inflating class image. Anyone can tell me why this happened and why this error is come.

  • Test case add `defaultConfig { vectorDrawables.useSupportLibrary = true }` in your **`build.gradle`** file – AskNilesh Jul 26 '18 at 12:56
  • use android:src instead of app:srcCompat –  Jul 26 '18 at 12:57
  • defaultConfig { vectorDrawables.useSupportLibrary = true } i was added in build gradle file.again same error its come . app build gradle : vectorDrawables.useSupportLibrary = true implementation "com.android.support:support-v4:27.0.2" implementation "com.android.support:appcompat-v7:27.0.2" implementation "com.android.support:design:27.0.2" – Snehal Patil Jul 26 '18 at 13:05
  • Are you inflating that image inside an ImageView? if yes try using android.support.v7.widget.AppCompatImageView – DavideC Jul 26 '18 at 13:09
  • i was try this.getting error : Error inflating class android.support.v7.widget.AppCompatImageView – Snehal Patil Jul 26 '18 at 13:16
  • my xml Imageview : – Snehal Patil Jul 26 '18 at 13:18
  • take a look here https://stackoverflow.com/questions/47526417/binary-xml-file-line-0-error-inflating-class-imageview – DavideC Jul 26 '18 at 13:20
  • thank you, above stackoverflow link is very helpful for me. – Snehal Patil Jul 27 '18 at 05:38

1 Answers1

0

Add this in your application

static {
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
Mbuodile Obiosio
  • 1,463
  • 1
  • 15
  • 19