我遇到这些崩溃已经有一段时间了,我环顾四周并尝试了一个建议的解决方案,即使用 googleMap.clear()
,但它不起作用,因为我仍然收到崩溃报告,我正在使用最新的 google play 服务库 8.1.0
和 compileSdkVersion 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)
最佳答案
尝试在 list 文件的应用程序标记中添加android:largeHeap="true"
关于java - MapFragment - Google map 内存不足错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33495815/