我一直在为我的应用程序使用 MapView
,它运行良好。突然,在使用我的应用程序时,它因以下错误而崩溃
04-06 14:03:45.084 6969-7008/info.tommarsh.testmap E/EGL_emulation: rcCreateContext returned 0
04-06 14:03:45.084 6969-7008/info.tommarsh.testmap E/EGL_emulation: tid 7008: eglCreateContext(1284): error 0x3003 (EGL_BAD_ALLOC)
04-06 14:03:45.085 6969-7008/info.tommarsh.testmap E/AndroidRuntime: FATAL EXCEPTION: GLThread 185
Process: info.tommarsh.testmap, PID: 6969
java.lang.RuntimeException: createContext failed: 12291
at com.google.maps.api.android.lib6.gmm6.vector.bi.a(:com.google.android.gms.DynamiteModulesB:834)
at com.google.maps.api.android.lib6.gmm6.vector.bj.f(:com.google.android.gms.DynamiteModulesB:20825)
at com.google.maps.api.android.lib6.gmm6.vector.bj.run(:com.google.android.gms.DynamiteModulesB:881)
现在,每次我输入使用 MapView
的 Fragment 或 Activity 时,都会发生完全相同的错误。需要注意的几点:
- 这发生在我尝试过的每个模拟器上(x86 和 x86_64 ABI)
- 尝试启动
MapFragment
时也会发生这种情况 - 我使用的是 map 10.2.1 版
感谢任何帮助!
最佳答案
看起来问题出在模拟器图形上。在创建新的模拟器时,模拟性能中有一些选项。仿真性能具有三个选项自动、硬件 GLES 或软件 GLES。
选择软件 GLES 并查看结果。 -map 会慢一点,但总比有错误好。
单击所附图片的链接,选择仿真性能。
关于android - 谷歌地图 API 崩溃(使用 Android 模拟器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43257713/