-1

When i'm trying to run my application i receive the error as The application SV (process.com.app) has stopped unexpectedly. Please try again Force close error. Logcat error is given below

12-27 08:57:05.779: D/dalvikvm(278): GC_EXTERNAL_ALLOC freed 866 objects / 60952 bytes in 87ms
12-27 08:57:07.480: E/dalvikvm-heap(278): 11186176-byte external allocation too large for this process.
12-27 08:57:07.480: E/GraphicsJNI(278): VM won't let us allocate 11186176 bytes
12-27 08:57:07.480: E/dalvikvm-heap(278): 11186176-byte external allocation too large for  this process.
12-27 08:57:07.480: E/GraphicsJNI(278): VM won't let us allocate 11186176 bytes
12-27 08:57:07.489: D/AndroidRuntime(278): Shutting down VM
12-27 08:57:07.489: W/dalvikvm(278): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-27 08:57:07.528: E/AndroidRuntime(278): FATAL EXCEPTION: main
12-27 08:57:07.528: E/AndroidRuntime(278): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app/com.app.ScreenActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.os.Handler.dispatchMessage(Handler.java:99)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.os.Looper.loop(Looper.java:123)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread.main(ActivityThread.java:4627)
12-27 08:57:07.528: E/AndroidRuntime(278):  at java.lang.reflect.Method.invokeNative(Native Method)
12-27 08:57:07.528: E/AndroidRuntime(278):  at java.lang.reflect.Method.invoke(Method.java:521)
12-27 08:57:07.528: E/AndroidRuntime(278):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-27 08:57:07.528: E/AndroidRuntime(278):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-27 08:57:07.528: E/AndroidRuntime(278):  at dalvik.system.NativeStart.main(Native Method)
12-27 08:57:07.528: E/AndroidRuntime(278): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.createView(LayoutInflater.java:513)
12-27 08:57:07.528: E/AndroidRuntime(278):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
12-27 08:57:07.528: E/AndroidRuntime(278):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.Activity.setContentView(Activity.java:1647)
12-27 08:57:07.528: E/AndroidRuntime(278):  at com.app.ScreenActivity.onCreate(ScreenActivity.java:20)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-27 08:57:07.528: E/AndroidRuntime(278):  ... 11 more
12-27 08:57:07.528: E/AndroidRuntime(278): Caused by: java.lang.reflect.InvocationTargetException
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.widget.ImageView.<init>(ImageView.java:108)
12-27 08:57:07.528: E/AndroidRuntime(278):  at java.lang.reflect.Constructor.constructNative(Native Method)
12-27 08:57:07.528: E/AndroidRuntime(278):  at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.LayoutInflater.createView(LayoutInflater.java:500)
12-27 08:57:07.528: E/AndroidRuntime(278):  ... 22 more
12-27 08:57:07.528: E/AndroidRuntime(278): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.Bitmap.nativeCreate(Native Method)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.content.res.Resources.loadDrawable(Resources.java:1709)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.view.View.<init>(View.java:1885)
12-27 08:57:07.528: E/AndroidRuntime(278):  at android.widget.ImageView.<init>(ImageView.java:112)
12-27 08:57:07.528: E/AndroidRuntime(278):  ... 26 more

Plrease help. how to solve it

user1931166
  • 435
  • 1
  • 5
  • 6
  • Better change the heading to specific problem.... – vnshetty Dec 27 '12 at 04:18
  • In this post is solved your question? http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue-while-loading-an-image-to-a-bitmap-object/823966#823966 – hcarrasko Dec 27 '12 at 04:29

2 Answers2

1

you have a memory leak and the Android OS can't create a new layout. - or a to big image.

Exactly about this I told in a few answers ago.

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

Android - where to keep global data?

There are severaly possibilty how to detect memory leak and how to remove it:

Search for: "unbind Android components"

Community
  • 1
  • 1
  • how to solve it. I'm new to android – user1931166 Dec 27 '12 at 04:14
  • please provide the layout xml and tell for us: if you have references to the activity, how is the biggest background image size in pixels, which are you loadiing, are you doing rotations? –  Dec 27 '12 at 04:18
  • no rotation size exceeds 2mp – user1931166 Dec 27 '12 at 04:20
  • 2 million pixel x 4 = 8 megabytes, just for image, at least! you have a 16/24/32 Mb limit for your app. Put a smaller image there to allow space for your app –  Dec 27 '12 at 04:22
1

The below is caused by iflating a view.

  Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>

Caused by: java.lang.reflect.InvocationTargetException

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

Your bitmap size is making it to run out of memory. Check these and try to avoid these. If you still can't get it done on these specific things, you could post your respective code snippets where these errors occur. So that others could edit answers.

Kanth
  • 6,681
  • 3
  • 29
  • 41