1

I have android crash report from the market but i don't know how to go about it. I don't understand if the error is about a layout or if it is about an exception that is not caught by one of the activities in my project file. Please help out:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.fab.MyMotivApp/com.fab.MyMotivApp.Options}: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:518)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
at android.app.Activity.setContentView(Activity.java:1657)
at com.fab.MyMotivApp.Options.onCreate(Options.java:16)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.view.LayoutInflater.createView(LayoutInflater.java:505)
... 21 more
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.content.res.Resources.loadDrawable(Resources.java:1709)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.view.View.<init>(View.java:1951)
at android.view.View.<init>(View.java:1899)
at android.view.ViewGroup.<init>(ViewGroup.java:286)
at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
... 24 more
faby
  • 41
  • 4
  • The key line seem to be `Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) '. Are you loading an image when your app starts, such as a background? – Ken White Nov 25 '11 at 03:36
  • yes I loaded two images. How do I know which of the images is causing the problem? Any idea of any default size to be used because the first image fills the entire screen while the other fills just half of the screen. – faby Nov 25 '11 at 04:17

1 Answers1

1

You are having problems inflating the XML layout file. however, the main culprit is this:

Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Basically, it's telling you that your image is too big to fit memory constraints (remember, these are a resource critical devices).

One of the possible solutions is this famous answer.

You could try resizing the image, of course. There are some tricks you can apply (optimizations etc).

Community
  • 1
  • 1
davidcesarino
  • 16,160
  • 16
  • 68
  • 109
  • Save an image with a higher compression, depending on which kind of image codec you're saving your image to begin with. Nothing fancy. :-) Back to your problem, did you try the solutions there? There are a couple, and that topic is "the" reference when dealing with this kind of problem. Truth be told, I already had this problem before (helped me spot it quickly), and that topic helped me. – davidcesarino Nov 25 '11 at 04:19