Missing Google Play Services from AVD

后端 未结 7 990
南旧
南旧 2020-12-28 08:24

I recently started developing for Android, and I have come into trouble when trying to use Google Maps in my app. I downloaded the Google Maps API v2 for Android, and have a

相关标签:
7条回答
  • 2020-12-28 08:41

    Unfortunately, you can't use the emulator to run apps that use Google Play services. From http://developer.android.com/google/play-services/setup.html: "Google Play services is not supported on the Android emulator — to develop using the APIs, you need to provide a development device such as an Android phone or tablet."

    0 讨论(0)
  • 2020-12-28 08:42

    If anyone is still experiencing this issue, first try to create your emulator with the Google API's as the platform target. After doing so, I noticed that my Google Play Services was not the correct version on the emulator.

    While trying to hack together a solution, I stumbled upon the GoogleApiAvailability class here. Google did a phenomenal job handling compatibility issues.

    GoogleApiAvailability.isGooglePlayServicesAvailable(Context) returns an integer status code, which can be fed directly into getErrorDialog(Activity, errorCode, requestCode) which returns a Dialog that works perfectly right out of the box. If your Play Services are out of date, the dialog will redirect you to an updater... If they are missing, it will redirect you to an installer, etc...

    Thought I would share this great feature in case anyone is looking for a fix that would work in production code as well as testing.

    0 讨论(0)
  • 2020-12-28 08:43

    I had this same problem and found solution:

    Here are the updated gms and vending files. Same instructions as before: Create a new emulator with any cpu/abi, a non google-api target (versions 10-17 work) and gpu emulation on or off, and then install the files:

    adb install com.android.vending-20130716.apk 
    adb install com.google.android.gms-20130716.apk 
    

    If you are upgrading an existing emulator then you might need to uninstall previous versions by:

    adb uninstall com.android.vending
    adb uninstall com.google.android.gms
    
    0 讨论(0)
  • 2020-12-28 08:44

    I found this, i hope it helps you ;)

    Installing Google Play on Android Emulator

    Run Google Play Services in your emulator

    0 讨论(0)
  • 2020-12-28 08:51

    Yes, you can use Google maps on emulator. However, it's not officially supported, so takes some work. I had the best success following the info on this link.

    0 讨论(0)
  • 2020-12-28 08:53

    Bellow link contains a solution that works with Android 4.2.2 or higher

    How to install Google Play Services in Android Emulator

    1.1 Start your emulator. Disconnect any other Android device (such as your smartphone) from computer. 1.2 Download these two files

    com.android.vending-19032013.apk : http://www.mediafire.com/download.php?7jfar2v1bzx6v59 com.google.android.gms-19032013.apk : http://www.mediafire.com/download.php?4o9fz413uavlblf

    1.3 Open command console, go to \platform-tools

    Install two files above with command

    adb install \com.android.vending-19032013.apk adb install \com.google.android.gms-19032013.apk

    0 讨论(0)
提交回复
热议问题