InflateException: Binary XML file line #8: Error inflating class ImageView

What helped me is just copying the image file (.png in my case)

  • from res\drawable-v24

  • to \res\drawable directory.

Will happy if this post will save time to somebody else.


If you are using vector drawables, use

app:srcCompat="@drawable/ic_dot"

instead of

android:src="@drawable/ic_dot"

binary xml file line #0: error inflating class imageview

you have to see if your image has become drawable-v23 or v24 which might be higher than your mobile os level, Make sure to avoid creating drawable version image in project

example In drawable folder ~> "ic_contact(v24)"


The stack trace doesn't show it, but the error during inflation might come from drawable used in the ImageView, in this case:

android:src="@drawable/ic_dot"

OP tested this hunch, by trying a different drawable which "seems ok right now...".