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:
- [Solved] Java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- The image set by app: srccompat in Android constraintlayout cannot be displayed
- Android Your content must have a ListView whose…
- Eclipse’s shortcut Ctrl + Shift + F doesn’t work
- Ffmpeg scaling — the solution of “width / height not divisible by 2”
- [Solved] echart Error: Can’t get dom width or height
- Android: layout layout page can not be displayed, prompt: one or more layouts are missing the layout_width or layout_height attrib…
- UICollectionView must be initialized with a non-nil layout parameter [Solved]
- [Solved] Android Warning: android.content.res.Resources$NotFoundException: Resource ID #0x7f08010a
- A problem with 0 document. Documentelement. Clientwidth