Running Google Maps v2 on the Android emulator
Solution 1
At the moment, referencing the Google Android Map API v2 you can't run Google Maps v2 on the Android emulator; you must use a device for your tests.
Solution 2
For those who have updated to the latest version of google-play-services_lib and/or have this error Google Play services out of date. Requires 3136100 but found 2012110
this newer version of com.google.android.gms.apk (Google Play Services 3.1.36) and com.android.vending.apk (Google Play Store 4.1.6) should work.
Test with this configuration on Android SDK Tools 22.0.1. Another configuration that targets pure Android, not the Google one, should work too.
- Device: Galaxy Nexus
- Target: Android 4.2.2 - API Level 17
- CPU/ABI: ARM (armeabi-v7a)
- Checked: Use Host GPU
...
- Open the AVD
-
Execute this in the terminal / cmd
adb -e install com.google.android.gms.apk adb -e install com.android.vending.apk
Restart the AVD
- Have fun coding!!!
I found this way to be the easiest, cleanest and it works with the newest version of the software, which allow you to get all the bug fixes.
Solution 3
Please try the following. It was successfully for me.
Steps:
Create a new emulator with this configuration:
-
Start the emulator and install the following APK files:
GoogleLoginService.apk
,GoogleServicesFramework.apk
, andPhonesky.apk
. You can do this with the following commands:adb shell mount -o remount,yourAvdName -t yaffs2 /dev/block/mtdblock0 /system adb shell chmod 777 /system/app adb push GoogleLoginService.apk /system/app/ adb push GoogleServicesFramework.apk /system/app/ adb push Phonesky.apk /system/app/
Links for APKs:
- GoogleLoginService.apk
- GoogleServicesFramework.apk
- Phonesky.apk AKA Google Play Store, v.3.5.16
- Google Maps, v.6.14.1
- Google Play services, v.2.0.10
-
Install Google Play services and Google Maps in the emulator
adb install com.google.android.apps.maps-1.apk adb install com.google.android.gms-2.apk
- Download Google Play Service revision 4 from this link and extra to folder
sdkmanager->extra->google play service
. - Import
google-play-services_lib
fromandroidsdk\extras\google\google_play_services
. - Create a new project and reference the above project as a library project.
- Run the project.
Solution 4
I've successful installed Google Maps v2 on an emulator using this guide.
You should do the following steps:
- Create a new emulator Nexus S, Android 2.3.3. Don't use Google API.
- Install com.android.vending.apk (Google Play Store, v.3.10.9)
- Install com.google.android.gms.apk (Google Play Service, v.2.0.12)
Solution 5
I recommend using the emulator by Genymotion instead of Google's emulators. It launches way faster and responds almost in real-time. It also supports Google Play Services and therefore Google Maps.
Give it a try! Here is a blog post which helps you setting up the emulator.
Related videos on Youtube
Dawid
Updated on June 15, 2020Comments
-
Dawid almost 4 years
I've tried to implement Google Maps v2 in my Android application, but unfortunately instead of maps I get this message:
Is it possible to run these maps on the Android emulator (Platform 4.2)?
-
JJD over 10 years
-
Armel Larcier over 10 yearssee here for a blazing fast virtualization solution : stackoverflow.com/a/18871458/1491212
-
rptwsthi over 10 yearspossible duplicate of This app won't run unless you update Google Play Services. (via Bazaar)
-
-
Dawid over 11 yearsThank you, but after choosing "Android+Goodle API's" I can see another Message: <img255.imageshack.us/img255/6353/przechwytywaniera.png >
-
David over 11 yearsI think this is a bug, because google play is never installed on the emulator, and google play usually updated the google play services apk, you may copy the google play services apk from a device and install it on the emulator
-
sabadow over 11 yearsSome users created an emulator that supports it! stackoverflow.com/questions/13691943/…
-
sabadow over 11 yearsSome users created an emulator that supports it! stackoverflow.com/questions/13691943/…
-
brabertaser19 about 11 yearswhere did you get apk files?
-
user2101068 about 11 yearsSorry....It's been a while so I don't recall where I got the files but I'm pretty sure I just Googled them and found them on line.
-
Joel Malone almost 11 yearsRegarding not being able to two-finger-tap to zoom out, you can use a tap-tap-slide up or down to zoom in and out, which works with one finger (i.e. mouse).
-
Dan Devine almost 11 yearsYes, it works... but does require installation of separate APK's into emulator image.
-
Dan Devine almost 11 yearsI discovered that selecting an emulator image which includes the Google API's does not work. When attempting to install the above apk's, adb reported "Failed: Already installed". When running the application, the map just returned gray. When selecting an emulator WITHOUT Google APIs, and manually installing the APKs, everything worked correctly.
-
Nuntipat Narkthong almost 11 yearsYes, you should select an image without the Google API. As I've already indicated in the second paragraph "Other configuration that target pure Android not the google one should work to.".
-
Muhammad Babar over 10 years@PalmRobotZ is it possible to show
GoogleAndroidMapsV2
on Android 2.2 Emulator? -
prap19 over 10 yearsIf I do not use Google Api for emulator image then while installing my app I get this error "INSTALL_FAILED_MISSING_SHARED_LIBRARY". What to do in such a case?
-
Rishabh Srivastava over 10 yearsGenymotion has stopped the google play services now.
-
JJD over 10 years@RishabhSrivastava You have to install GoogleApps yourself. Please read this and this posts.
-
Saqlain about 10 yearsI am using Android 4.4.2 on Emulator with Hardware Acceleration enabled, just install com.google.android.gms-2.apk, com.google.android.apps.maps-1.apk and Phonesky.apk, using adb and with this i got google map working on Emulator...Btw these apk's are downloadable from above answer...
-
Hsu Wei Cheng almost 9 yearsIt need extra works to work on android emulator. It's POSSIBLE!
-
obayhan almost 9 yearsYes you can do with some efford
-
C0D3 almost 8 yearsYou need to create an Google services API key for your app here: console.developers.google.com/apis then add this key to google_maps_api.xml file that is in your project
-
arekolek about 7 yearsThis is true. In addition, API 19 also worked for me.
-
Shahzain ali about 7 yearsFailure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]