FATAL EXCEPTION: main
Process: com.onyebuchboss.bossweatherbitcoinapp, PID: 11494
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.onyebuchboss.bossweatherbitcoinapp/com.onyebuchboss.bossweatherbitcoinapp.OptionActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2808)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1544)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6293)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1094)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class <unknown>
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
at android.view.LayoutInflater.createView(LayoutInflater.java:645)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.onyebuchboss.bossweatherbitcoinapp.OptionActivity.onCreate(OptionActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6702)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2696)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2808)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1544)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6293)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1094)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 493807116 byte allocation with 4194304 free bytes and 155MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:655)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:483)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1160)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:841)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:641)
at android.content.res.Resources.loadDrawable(Resources.java:976)
at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
at android.view.View.<init>(View.java:4348)
at android.view.ViewGroup.<init>(ViewGroup.java:616)
at android.widget.RelativeLayout.<init>(RelativeLayout.java:268)
at android.widget.RelativeLayout.<init>(RelativeLayout.java:264)
at android.widget.RelativeLayout.<init>(RelativeLayout.java:260)
Asked
Active
Viewed 39 times
-1

Ben P.
- 52,661
- 6
- 95
- 123

Victor Onyebuchi
- 99
- 10
-
1Caused by: java.lang.OutOfMemoryError: Failed to allocate a 493807116 byte allocation with 4194304 free bytes and 155MB until OOM – Johannes Kuhn Mar 24 '18 at 03:29
-
What do you think happened here? – Johannes Kuhn Mar 24 '18 at 03:29
-
Either you are trying to deserialize a *massive* (~500Mbyte) bitmap ... or the XML is corrupted. – Stephen C Mar 24 '18 at 04:29
1 Answers
0
The useful part of this error is the java.lang.OutOfMemoryError
part. Going down from that, you can see stack calls related to decoding a bitmap. What this is saying is that you have a large bitmap that is causing an out of memory error when loading.
Check all ImageViews in your xml and look for large images.
When you get crashes loading layouts, the actual errors are usually hidden further into the crash log.

Warrick
- 1,623
- 1
- 17
- 20
-
Thanks Warrick. I just resolved the issue, it was the only image attached to the XML file that's too large. Thank you – Victor Onyebuchi Mar 25 '18 at 10:39
-
Also, you should add some more info into the question rather than just posting a crash log. Even just mention that its crashing when the activity starts is all you need to provide some context. – Warrick Mar 26 '18 at 03:21