InflateException: Binary XML file line #1: Error inflating class unknown caused by OutOfMemoryError
Check your drawable/background_main
i.e. the background image of your root layout - the VM runs out of memory when decoding the bitmap. Make the image dimensions smaller.
InflateException: Binary XML file line #21: Error inflating class unknown caused by OutOfMemoryError
You have a bunch of ImageView
widgets on which you are using android:background
rather than android:src
. It is unclear why you are doing this.
Regardless, on one of those, you are attempting to load a drawable resource that, when decoded, would take up 9437196 bytes of heap space. That is the equivalent of a 1536x1536 image. This is much too large.
So, switch to android:src
and use much lower-resolution bitmaps. The size of the bitmaps on disk is irrelevant.
Also, if you happened to put these images in res/drawable/
, bear in mind that this is synonymous with res/drawable-mdpi/
and indicates that your images should be upscaled for higher-density screens.
Android: InflateException: Binary XML file line : Error inflating class unknown
it would be better if u change the size of images you using. may be that sizes not capable for that device you using.
android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
My picture was 5000x7000(TOO BIG!). Fixed by resizing it!
android.view.InflateException: Binary XML file line #24: Error inflating class unknown
i added
android:largeHeap="true"
to my AndroidManifest.xml inside application tag and seem's like It works, at least for the crash casuistic. Hope It keeps well-functioning...
Related Topics
How and Where Are Annotations Used in Java
Private Final Static Attribute VS Private Final Attribute
Encoding Url Query Parameters in Java
How to Limit the Number of Characters in Jtextfield
How to Make an Array of Arrays in Java
Mapping Manytomany with Composite Primary Key and Annotation:
Turning Off Hibernate Logging Console Output
Sort Arrays of Primitive Types in Descending Order
How to Implement in Java ( Jtextfield Class ) to Allow Entering Only Digits
Can Not Find the Tag Library Descriptor for "Http://Java.Sun.Com/Jsp/Jstl/Core"
How Returns Xxxsize from Jcomponent(S) Added to the Jlabel
Custom JSON Deserialization with Jackson
How to Scroll More Than One Object at the Same Time
How to Use an Arraylist as a Prepared Statement Parameter