Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.OutOfMemoryError on Android 4.0 (API 14)

Tags:

android

tabs

api

I have an Android app that works well in the emulators for Android 2.2, 2.3.1 & 2.3.3. But when I test it out on Android 4.0, it gives this error:

Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo
…
…    
Caused by: java.view.InflateException
…
…
Caused by: java.lang.reflect.InvocationTargetException
…
…
Caused by: java.lang.OutOfMemoryError

It occurs everytime I try to go the next activity! (I use a TabActivity which has 3 activities within it).

I am not sure what has changed in API 14. Please advice.

like image 301
Ahmed Avatar asked Oct 20 '11 14:10

Ahmed


1 Answers

Check the value of the "Max VM application heap size" parameter in the AVD you use. Android 3.x AVD uses by default 48 Mb, so it should be at least not less for Android 4.0.
I couldn't find the specification of Galaxy S II with heap size info included, but I suggest you to try 48 or 64 Mb.

like image 172
Idolon Avatar answered Nov 06 '22 23:11

Idolon