Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API Crashing (Using Android Emulator)

I have been using MapView for my app, which had been working fine. Suddenly, when using my application it crashed with the following error

  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)

Now every time I enter a Fragment or Activity that uses MapView the same exact same error occurs. Few things to note:

  • This happens on every emulator I have tried (both x86 and x86_64 ABI)
  • It also happens when trying to launch MapFragment
  • I am using Maps version 10.2.1

Any help appreciated!

like image 427
Tmarsh2 Avatar asked Oct 30 '22 09:10

Tmarsh2


1 Answers

It looks like the problem is with emulator graphics. While creating new emulator there are some option in Emulated performance. Emulated performance has three options Automatic, Hardware GLES or Software GLES.

Choose Software GLES and see the result. -map will be a bit slower but better than having errors.

Click the link of attached picture where to choose Emulated Performance.

where to choose Emulated Performance

like image 199
Azhar Zafar Avatar answered Nov 15 '22 07:11

Azhar Zafar