MapFragment - Google地图内存不足错误

时间:2015-11-03 09:43:31

标签: java android google-maps out-of-memory

我已经暂时解决了这些问题,我已经环顾四周并尝试了一个建议的解决方案,即使用googleMap.clear()并没有像我一样工作;我还在报告崩溃,我使用的是最新的google play service library 8.1.0compileSdkVersion 23 buildToolsVersion" 23.0.1"。 此崩溃似乎只发生在Android 5.0上

java.lang.OutOfMemoryError: Failed to allocate a 4194316 byte allocation with 1301325 free bytes and 1270KB until OOM 1
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method) 2
        at android.graphics.Bitmap.nativeCreate(Native Method) 3
        at android.graphics.Bitmap.createBitmap(Bitmap.java:939) 4
        at android.graphics.Bitmap.createBitmap(Bitmap.java:912) 5
        at android.graphics.Bitmap.createBitmap(Bitmap.java:879) 6
        at com.google.maps.api.android.lib6.gmm6.n.c.i.a(Unknown Source) 7
        at com.google.maps.api.android.lib6.gmm6.n.c.l.a(Unknown Source) 8
        at com.google.maps.api.android.lib6.gmm6.n.c.l.a(Unknown Source) 9
        at com.google.maps.api.android.lib6.gmm6.n.c.l.b(Unknown Source) 10
        at com.google.maps.api.android.lib6.gmm6.n.c.b.ak.a(Unknown Source) 11
        at com.google.maps.api.android.lib6.gmm6.n.c.b.as.a(Unknown Source) 12
        at com.google.maps.api.android.lib6.gmm6.n.x.a(Unknown Source) 13
        at com.google.maps.api.android.lib6.gmm6.n.l.a(Unknown Source) 14
        at com.google.maps.api.android.lib6.gmm6.n.l.b(Unknown Source) 15
        at com.google.maps.api.android.lib6.gmm6.n.cv.f(Unknown Source) 16
        at com.google.maps.api.android.lib6.gmm6.n.cv.run(Unknown Source)

1 个答案:

答案 0 :(得分:0)

尝试在您的清单文件的应用标记中添加android:largeHeap="true"