0

I made a project related on the base of telephon system. It works fine in any Samsung android set,HTC and Motorola. But the problem is when i tried to run it in Sony Ericsson Android set it's getting force close in every even time i open the application.

(1st time i open the application it works fine,2nd time open,getting force close....3rd time open, 4th time force close... repeated....)

This is my logcat

08-29 16:53:03.346: E/AndroidRuntime(5812): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.excel.extel/com.excel.extel.ExtelMain}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.excel.extel/com.excel.extel.DialerTab}: android.view.InflateException: Binary XML file line #83: Error inflating class <unknown>
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.access$1500(ActivityThread.java:121)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.os.Looper.loop(Looper.java:123)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.main(ActivityThread.java:3701)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at java.lang.reflect.Method.invokeNative(Native Method)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at java.lang.reflect.Method.invoke(Method.java:507)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at dalvik.system.NativeStart.main(Native Method)
08-29 16:53:03.346: E/AndroidRuntime(5812): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.excel.extel/com.excel.extel.DialerTab}: android.view.InflateException: Binary XML file line #83: Error inflating class <unknown>
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.startActivityNow(ActivityThread.java:1499)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:676)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.TabHost.setCurrentTab(TabHost.java:348)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.TabHost.addTab(TabHost.java:238)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.excel.extel.ExtelMain.onCreate(ExtelMain.java:67)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
08-29 16:53:03.346: E/AndroidRuntime(5812):  ... 11 more
08-29 16:53:03.346: E/AndroidRuntime(5812): Caused by: android.view.InflateException: Binary XML file line #83: Error inflating class <unknown>
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.Activity.setContentView(Activity.java:1657)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at com.excel.extel.DialerTab.onCreate(DialerTab.java:139)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
08-29 16:53:03.346: E/AndroidRuntime(5812):  ... 20 more
08-29 16:53:03.346: E/AndroidRuntime(5812): Caused by: java.lang.reflect.InvocationTargetException
08-29 16:53:03.346: E/AndroidRuntime(5812):  at java.lang.reflect.Constructor.constructNative(Native Method)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-29 16:53:03.346: E/AndroidRuntime(5812):  ... 32 more
08-29 16:53:03.346: E/AndroidRuntime(5812): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:460)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:715)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.content.res.Resources.loadDrawable(Resources.java:1713)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.view.View.<init>(View.java:1969)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.ImageView.<init>(ImageView.java:116)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.ImageButton.<init>(ImageButton.java:85)
08-29 16:53:03.346: E/AndroidRuntime(5812):  at android.widget.ImageBu

Anybody tell me whats the problem?Is it my fault or the set's problem?

Swayam
  • 16,294
  • 14
  • 64
  • 102
MBMJ
  • 5,323
  • 8
  • 32
  • 51
  • Could you post the log here? And also some code where you get the error.. – Cata Aug 29 '12 at 10:47
  • We can't help you until you provide us the full stack trace. – Alexis C. Aug 29 '12 at 10:47
  • Its an application with huge code.Ok i will give the logcat error – MBMJ Aug 29 '12 at 10:48
  • Have you check the OS version of Sony Ericsson device? – Benoit Aug 29 '12 at 10:48
  • 1
    If there any problem of OS version related problem it will never run.But my problem is it run and at every even(2,4,6,8,...) time its getting force close – MBMJ Aug 29 '12 at 10:49
  • Most likely due to your application code. Without looking at any code or stack-trace, I suspect an OOM due to a memory leak. – Che Jami Aug 29 '12 at 11:08
  • If there any prob in code it will never run in other device,and i dont understand who give the negative vote? – MBMJ Aug 29 '12 at 11:12

1 Answers1

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

This means that the device has gone out of memory and it is being force closed.

Now, since you say that the application is running for the first time but not henceforth, I believe that you are not freeing the resources. Bitmaps can sometime take up a lot of space and if you are persisting them in the memory, I would not be surprised if the device goes OOM. Different devices have different specs for memory and that is the reason it is running on some but not on others.

So, my suggestion would be to clear the Bitmaps and the other storage that you are using for temporary purposes.

If that still does not solve your problem, post the code where you are handling the images and we will try to see if there is a more memory efficient way of what you are doing.

Good luck!

Swayam
  • 16,294
  • 14
  • 64
  • 102