Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Google Maps v2 on the Android emulator

I've tried to implement Google Maps v2 in my Android application, but unfortunately instead of maps I get this message:

This app won't run without Google Play services which are missing from your phone.

Is it possible to run these maps on the Android emulator (Platform 4.2)?

like image 583
Dawid Avatar asked Dec 26 '12 11:12

Dawid


People also ask

How do I use Google Maps on Android Emulator?

The Google Android Map API is not able to run Google Maps on the Android emulator. You must use an Android device for testing your app. In another case, if you still want to use it through: then it requires installation of separate APK files into the emulator image. Use Google Maps on Emulator.

Is there a Google Android emulator?

Use Android Emulator for free. This extension allows you to play your favorite games or using applications from Google Play Store. You just need to add to Chrome our extension and instantly you're able to use your new mobile phone in your browser.


3 Answers

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.

like image 173
AliR Avatar answered Oct 16 '22 12:10

AliR


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

...

  1. Open the AVD
  2. Execute this in the terminal / cmd

    adb -e install com.google.android.gms.apk
    adb -e install com.android.vending.apk
    
  3. Restart the AVD

  4. 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.

like image 26
Nuntipat Narkthong Avatar answered Oct 16 '22 13:10

Nuntipat Narkthong


Please try the following. It was successfully for me.

Steps:

  1. Create a new emulator with this configuration: AVD configuration

  2. Start the emulator and install the following APK files: GoogleLoginService.apk, GoogleServicesFramework.apk, and Phonesky.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:

    1. GoogleLoginService.apk
    2. GoogleServicesFramework.apk
    3. Phonesky.apk AKA Google Play Store, v.3.5.16
    4. Google Maps, v.6.14.1
    5. Google Play services, v.2.0.10
  3. 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
    
  4. Download Google Play Service revision 4 from this link and extra to folder sdkmanager->extra->google play service.
  5. Import google-play-services_lib from androidsdk\extras\google\google_play_services.
  6. Create a new project and reference the above project as a library project.
  7. Run the project.
like image 14
Kirit Vaghela Avatar answered Oct 16 '22 12:10

Kirit Vaghela