5

I want to install my map application in emulator it installed fine but not getting map on it,showing error in log cat like Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above, but I am Just seeing zoom buttons and all other UI. What i have to do to get map in emulator in android API v2.

I followed this link: Running Google Maps v2 on the Android emulator

Community
  • 1
  • 1
Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138

4 Answers4

4

I got finally map in my emulator. I followed these steps to achieve it.

  1. Create avd and start emulator

  2. Go to platform tools path present in Android SDK and put these apk's in it.

  3. Install these apk's one by one by going to platform tools path by using command prompt(shift+Right click-->open command window here).Follow these commands

    • adb devices
    • adb install com.android.vending.apk
    • adb install com.google.android.gms.apk
  4. Import google-play-services_lib project which is present at project location and add it to your project.(path of lib project:D:\Softwares\android-sdk\extras\google\google_play_services\libproject)
  5. Restart emulator and clean your project and run it through emulator.

That's it. :)

enter image description here

Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138
  • can you provide a source for how you got the google play apk file you put in your dropbox? 'cos e.g. maybe there's a later one now – barlop Jan 17 '15 at 11:57
  • doesn't work for me I get "invalid APK file" http://pastebin.com/raw.php?i=uYPQbZ6Y – barlop Jan 17 '15 at 16:20
  • @barlop Have you installed apk's mentioned above?? – Shailendra Madda Jan 20 '15 at 10:36
  • I just tried again and it worked pastebin.com/raw.php?i=QrMzLQQt But see my pastebin from the comment earlier where I tried and it didn't work.. Maybe it didn't work when my phone was attached. should it just be one item listed from adb devices - the emulator? – barlop Jan 20 '15 at 13:52
  • ok the adb install lines worked, but the default program coming with android studio BuildSystemExample gives a new error. Before, it said "Google play services, which some of your applications rely on, is not supported by your device. Please contact the manufacturer for assistance.". Now,and prior to importing the jar, It says "the app won't run unless you update google services" And if I (rightly or wrongly) wget these two files https://github.com/aporter/coursera-android/tree/master/Examples/google-play-services_lib/libs into the libs subdirectory I get gradle error. – barlop Jan 20 '15 at 18:51
  • perhaps I should add something to build.gradle to import the jar, i'm not sure exactly what/where or if i'm meant to do / not do anything else – barlop Jan 20 '15 at 18:51
  • I just removed the projects and android studio and reinstalled android studio.. the projects didn't reappear so I guess they weren't installed by android studio by default. There is a maps program one can create by default in android studio but it doesn't require any addition. So, if I need google play i'll look back at this. ta – barlop Jan 21 '15 at 03:02
  • In android studio changing the depencies from: com.google.android.gms:play-services:5.+ to: com.google.android.gms:play-services:5.0.+ – Shailendra Madda Jan 21 '15 at 11:23
  • thanks.. do you know how that would compare with the method in the answer to this http://stackoverflow.com/questions/27045599/google-play-services-in-genymotion-on-lollipop-android-5-0 (i.e. the method of dragging the arm zip to the device,...... and dragging the gapps file) – barlop Jan 21 '15 at 14:32
  • Actually I tried it in STS it's working like champ in it. i.e., Spring Tool Suit (Eclipse). But I am unaware of Android Studio.. – Shailendra Madda Jan 21 '15 at 14:59
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/69315/discussion-between-barlop-and-shylendra). – barlop Jan 21 '15 at 15:25
2

Google Maps API V2 require Google Play Services, which can be downloaded from Play Store, but since emulator doesn't have access to Play store, you cant get Play Services there and in turn the maps. At the moment, referencing the Google Android Map Api v2 you can't run google maps v2 on Android emulator; you must use a device for your tests.

Gaurav Arora
  • 1,805
  • 13
  • 13
  • So what is the best solution to test my Google Map android v2 app rather than emulator is there any other like that. – Shailendra Madda Oct 01 '13 at 06:24
  • Ideally, All of the Google APIs that use Google PLay Services should be tested on a real device. The alternative as SBerg413 mentioned below is GenyMotion emulator, which provides you access for PlayStore and in turn Play Services. – Gaurav Arora Oct 01 '13 at 13:02
  • You need to create an Google services API key for your app here: https://console.developers.google.com/apis/ then add this key to google_maps_api.xml file that is in your project – C0D3 Jun 24 '16 at 20:13
2

People seem to have trouble with the build in emulator and google maps. As an alternative, you could try this 3rd party emulator. People seem to have better luck with it and google maps. And it's supposed to be faster.

http://www.genymotion.com/

SBerg413
  • 14,515
  • 6
  • 62
  • 88
  • 1
    The good part here is GenyMotion Android emulator has access to PlayStore and in turn Google Play Services. – Gaurav Arora Sep 30 '13 at 14:20
  • I tried your steps.After installing it when i click on connect showing proxy unreachable – Shailendra Madda Sep 30 '13 at 15:22
  • @GauravArora not sure that geny still does. and it might take some fiddling to make it do so.. http://stackoverflow.com/questions/20121883/how-to-install-google-play-services-in-a-genymotion-vm-with-no-drag-and-drop-su – barlop Jan 17 '15 at 11:55
  • @barlop - you are correct. At least it doesn't by default. You need to "hack" it to get the PlayStore on there. – SBerg413 Jan 17 '15 at 12:00
0

After three days of reading tons and tons of tutorial on how to do this, this is the UP-TO-DATE solution with the UP-TO-DATE files and EASIEST steps to follow.

Steps. 1. Install genymotion emulator (This is way much faster than the eclipse emulator). All about it is easier. Research on how to start it.

Download these three apk's ()

Go to the platform tools folder of your adt bundle instalation folder (your_root_to_your_sdk\sdk\platform-tools). Open the sdk folder and there is the platform tools folder.

Paste the downloaded apks to the platform tools folder

Press Shit and right click the mouse, then press "Open command windows here"

In the cmd type adb devices and hit enter. Then your will use "adb install name_of_the_each_apk" for each of the three apks.

Open the google play and enter your account, and follow the steps: next, install google play services, open maps, and so on, they will guide you. That's all.

AS SIMPLE AS THAT.

Sterling Diaz
  • 3,789
  • 2
  • 31
  • 35