Android版谷歌地图在Nexus S上崩溃

时间:2012-04-18 17:22:59

标签: android maps nexus-s

我正在开发一款使用Google地图的应用。除特定设备外,它在所有设备上运行良好:Google Nexus S - 我们只能访问一台此类设备。 错误是在Maps中导航时,应用程序崩溃并出现OutOfMemoryError。 下面是堆栈跟踪:

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)

有人可以确认他们是否遇到过同样的问题?如果是这样,你碰巧有解决方案吗?

4 个答案:

答案 0 :(得分:1)

我在使用ICS 4.0.4的Galaxy S2上遇到了同样的问题。我从谷歌地图的应用菜单中清除了数据并强制停止了它。在此之后重新启动了Google地图,它运行良好。

答案 1 :(得分:0)

该应用程序内存不足。您是否在应用程序的其他位置使用了大量内存(即加载大型位图)?

答案 2 :(得分:0)

我和TF201碰到了同样的事情。

卸载所有更新,然后通过桌面市场重新安装。 (play.google.com)。 至少那对我有用。 可能删除缓存的数据和所有这些东西。

答案 3 :(得分:0)

以防万一有人偶然发现这个问题,这是Android开发人员关于如何有效使用位图的guide