Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Android API V2 not show maps on Emulator

I am following the tutorial to run Google Maps Android API V2. I am using an emulator. (I know a real device may solve the problem, but I do want to try emulator) The mapfragment shows a pale yellow background with two zoom buttons on it, and I got an error in LogCat that "Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above". I am using the most recent Android and Google Maps APIs (Android 4.2.2 and Google APIs 17)

I am a newbie to android and I've done a lot of searches. Here is what I have found:

  1. Maps were not supported on emulator, since Google Play services were not supported on emulator (unless tweaking emulator to work around this). But there is support now according to official page "Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services." on http://developer.android.com/google/play-services/setup.html

  2. there were also a lot of discussions about OpenGL ES 2.0 support on emulators, and it was said that OpenGL ES 2.0 was not supported on emulators at all. But here is a page (from google?) saying "As a bonus, since we’re now supporting OpenGL ES 2.0, your OpenGL games can now run inside the emulator" from http://android-developers.blogspot.ca/2012/04/faster-emulator-with-better-hardware.html. So confused!

I want to know if I can run google maps on emulator at all (with the newest versions of Android and Google APIs). Or I will have to switch to a real device or "tweak" the emulator.

Add: -- "use Host GPU" had been checked, and it doesn't help. Still the error "Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above".

-- Google announced emulator support for Maps android API v2 in May 2013. (I can't post the link due to user restriction but you can find it by going to the release page for Google Maps android API v2). But it doesn't seem to work.

UPDATE

The corresponding bug in Google issue tracker (https://issuetracker.google.com/issues/35822258) was solved some time ago.

Now you can use Google Maps Android API in emulator and create Virtual devices with Play services as described in this answer:

https://stackoverflow.com/a/46246782/5140781

like image 325
Jian Avatar asked Jun 20 '13 02:06

Jian


1 Answers

I, too, was tired of trying to make Google Maps v2 to work on Emulator. I ended up using a third party emulator call Genymotion. Not only the maps works perfectly, but it also runs much faster then the regular Android emulator, even faster then a real device.

Try it out!

like image 157
Androiderson Avatar answered Sep 20 '22 23:09

Androiderson