Search code examples
c#androidvisual-studio-2015xamarin.formsvisual-studio-emulator

How to install Google Play Services on a 6.0 Visual Studio Emulator?


I have followed the solution provided by Rob Prouse here to install Google Play Services on a Visual Studio Emulator running the Android 5.1.1 with API Level 22. This all worked well, and the maps in my application successfully worked, however, I am looking to make this work on a 6.0 device.

Rob Prouse Solution:

1 - Download the correct GAPPS for the Android version from http://www.teamandroid.com/gapps/
2 - Use the Additional Tools (small >> icon) for the emulator and go to the SD Card tab.
3 - Select a folder on your computer to sync with the virtual SD card.
4 - Pull from SD card, which will create a folder structure on the selected folder.
5 - Now copy the Gapps fill to the ‘Download’ folder.
6 - Push to SD card. This will take a little while, and copy the zip file to your emulator.
7 - Run a commmand prompt, and go to sdk\platform-tools in your Android SDK location and run adb devices.
8 - If you see the your emulator in the list, then skip to step 10.
9 - If you do not see emulator, run the following: adb connect <emulator ip>:5555 You can find the emulator ip, from within the emulator, go to Settings -> About Phone -> Status and IP section.
10 - Next run, adb shell. This will give you a prompt to the android emulator.
11 - Confirm the gapps file is there: ls /sdcard/Download
12 - Now run, install_zip.sh /sdcard/Download/.zip This should begin the flashing process.
13 - Once the flashing is complete, restart the emulator.
14 - Once you restart, you may see errors with apps like Google+ trying to start up, ignore them for now.
15 - Sign into your Google account and upgrade all apps from Google Play.
16 - When you run your application that requires Google Play services, you may be prompted to upgrade

I tried all three packages from http://www.teamandroid.com/gapps/, but none worked.
Note that the HDPI / MDPI / TINY: gapps-600-base-20151016-1-signed.zip installed the play store, but it keeps crashing and never opens.
I tried both adb commands and drag-and-drop solutions.
Has anyone been able to install the google play services into a 6.0 Visual Studio Emulator?


Solution

  • I ended up following another documentation about the emulator, and it worked well. For anyone who is having the same problem, take a look at this one: http://blog.ostebaronen.dk/2016/04/installing-gapps-in-visual-studio.html

    Solution from source:

    Prerequisites
    1. Install a Marshmallow image in the Visual Studio Emulator for Android tools (can be opened through Tools > Visual Studio Emulator for Android in Visual Studio)
    2. Download gapps-L-4-21-15.zip
    3. Download benzo-gapps-M-20151011-signed-chroma-r3.zip

    Installing
    1. Start the Marshmallow image
    2. Drag the gapps-L-4-21-15.zip onto the Emulator after it has booted. It will prompt you to install the zip and shutdown the device after that.
    3. After having install the gapps boot up your Emulator again, it will show a dialog about optimizing newly installed packages.
    4. Go to Settings > Accounts and Add a Google Account. Ignore all crashes.
    5. After adding the Account, install the benzo-gapps-M-20151011-signed-chroma-r3.zip by dragging it onto your Emulator, like in step 2.
    6. After rebooting after step 5. is done, you should now have working Play Services and Play Store on your Visual Studio Emulator for Android.