I am using Android studio 3.0
I am getting tired fixing this problem. the app does not execute it always show me this error Binary XML file line #0: Error inflating clas
Solution for this kind of problem: Binary XML file line #0: Error inflating class ImageView
Solution:
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.
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.
Well in my case it was crashing in only release builds because of proguard, so after i have added this line:
-keep class android.support.v7.widget.** { *; }
in file proguard-rules.pro
, the crash has been resolved.
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.
Use android:src="@drawable/doctor"
in your ImageView
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........ :)