Question

I am developing an app which makes use of Google Maps. It runs fine on all devices except for a specific device: Google Nexus S - we have access to only one such device. The error is that when navigating in Maps, the application crashes with an OutOfMemoryError. Below is the stack trace:

04-18 14:17:52.601 E/AndroidRuntime( 2714): FATAL EXCEPTION: main
04-18 14:17:52.601 E/AndroidRuntime( 2714): java.lang.OutOfMemoryError
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.graphics.Bitmap.nativeCreate(Native Method)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.graphics.Bitmap.createBitmap(Bitmap.java:585)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:444)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.google.android.maps.ZoomHelper.beginZoom(ZoomHelper.java:194)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.google.android.maps.MapView$2.onScaleBegin(MapView.java:380)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ScaleGestureDetector.onTouchEvent(ScaleGestureDetector.java:261)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:682)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.View.dispatchTouchEvent(View.java:5486)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1953)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1714)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1959)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1728)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1892)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.app.Activity.dispatchTouchEvent(Activity.java:2364)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1840)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.View.dispatchPointerEvent(View.java:5662)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2863)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.os.Looper.loop(Looper.java:137)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at android.app.ActivityThread.main(ActivityThread.java:4340)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at java.lang.reflect.Method.invokeNative(Native Method)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at java.lang.reflect.Method.invoke(Method.java:511)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-18 14:17:52.601 E/AndroidRuntime( 2714):     at dalvik.system.NativeStart.main(Native Method)

Can anybody confirm if they ran into the same issue? If so, do you happen to have a solution for this?

Was it helpful?

Solution

The app is running out of memory. Are you using a lot of memory other places in your app (i.e. loading large bitmaps)?

OTHER TIPS

I faced the same problem on my Galaxy S2 with ICS 4.0.4. I cleared the data from apps menu for Google map and force stopped it. Restarted Google Map after this and it worked fine.

I've ran into the same thing w/ my TF201.

Uninstall all the updates and then reinstall it via desktop market. (play.google.com) . At least that worked for me. Probably delete cached data and all that stuff too.

Just in case somebody stumbles upon this question, here's the guide from Android developers on how to work with bitmaps efficiently.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top