[Solved] android.view.InflateException: Binary XML file line #0: Error inflating class ImageView

Error: PID: 6851android.view.InflateException: Binary XML file line #0: Error inflating class ImageView

 

 

Solution.

1. Outermost layout adds: xmlns:app=“http://schemas.android.com/apk/res-auto”

2. Use app:srcCompat Reciver Vector

    <ImageView
        app:srcCompat="@drawable/ic_navigate_next_black_24dp"
        android:layout_gravity="center"
        android:layout_marginRight="8dp"
        android:layout_width="24dp"
        android:layout_height="24dp" />

 

3. Add vectorDrawables.useSupportLibrary = true

 

defaultConfig {
        。。。
        vectorDrawables.useSupportLibrary = true
    }

Similar Posts: