android - 谷歌地图 API 崩溃(使用 Android 模拟器)

标签 android google-maps google-maps-api-3

我一直在为我的应用程序使用 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 会慢一点,但总比有错误好。

单击所附图片的链接,选择仿真性能

where to choose Emulated Performance

关于android - 谷歌地图 API 崩溃(使用 Android 模拟器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43257713/

相关文章:

android - 如何处理super.onCreate中的异常?

javascript - fitBounds 调用后增加 map 缩放不起作用

android - 使用动画将 View 移动到屏幕顶部

java - 函数返回错误结果,但在具有相同字符串参数的调试器中返回良好结果

javascript - 如何在angularjs的函数中进入下一个摘要循环

javascript - 如何从谷歌地图标记数组中找出点击了哪个标记

javascript - 为谷歌地图样式加载外部 JSON 文件会中断后续的 map 操作

java - 我的 Google map fragment 显示灰色。我无法显示实际 map

java - 如何获取当前时间附近的时间 [Android Studio]

Android Oreo 8.0+ 禁用网络权限问题