Binary XML file line #0: Error inflating class ImageView
Solution for this kind of problem: Binary XML file line #0: Error inflating class ImageView
Solution:
- Check Your Image Folder, whether the image file is in Drawer or Drawer-24 or not. Example Here
Firebase image file is in Drawer-24
If image file is in drawer-24, Right Click the File and select Refactor and then click Move
Then remove the word "-24" and Click OK and RUN again.
Like this
DONE.
don't paste your image in drawable(v-24), paste it into the drawable folder and clean the project and then run it will work.
Some SVGs sources seem to not be fully supported. Add below line within your activity's onCreate() method:
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
and make sure you use below as attribute to your ImageView in your xml file: app:srcCompact instead of android:src to define your image.
In Android Studio version 3.0.0 and above, once we try to add images to drawable folder, it will ask you to 'Choose Destination Directory'. At that time, choose drawable
instead of drawable-v24
.
Keep Coding........ :)