3
votes

Here are some related threads, but these solutions are not working:

1.Running Google Maps v2 on the Android emulator

2.How to run Google Map API V2 on Android emulator

I even followed the documentation from Google Developer's on this issue. Still nothing.

To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK. If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.

To test your app when using the Google Play services SDK, you must use either:

  • A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
  • The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.

I am using the emulator Android 5.1.1 which is higher than Android 4.2.2, but when I run sample code for a map, I get a message on the emulator that says:

"Google Maps API demos won't run unless you update Google Play Services"

It gives me an option to update, but when I click on it, I get this message on the screen of my emulator:

"Unfortunatley, Google Maps API Demos has stopped"

Can anyone shed some light on this issue? I can set this up on a real device and test it, but I would much rather use an android emulator because it is so much faster.

2

2 Answers

7
votes

Make sure you are using the Google APIs (Google Inc.) as your Emulator's target. and if this doesn't solve the problem, you can google the newest Google Play Services' apk and install it over adb install.

=-=-= edit =-=-=
It seems like there is a bug regarding to the Google Play services on the API level 22 emulator. I filed a bug for it.
https://code.google.com/p/android/issues/detail?id=176348&thanks=176348&ts=1433887196

Google Play services seems to be fine on API 21, and API MNC

0
votes

If you're emulator is built upon an SDK platform with Google Play Services, and you're still getting runtime errors when trying to access Play Services APIs.....

Delete the emulator, and in the SDK manager, also uninstall the SDK platform on which that emulator was built.

Then, re-download that SDK platform and re-build your emulator.

Why?

If there have been updates to Google Play Services since you've downloaded said SDK platform and built that emulator, the legacy version of Google Play Services is probably still in that SDK platform's build.

I found the only way to get the most recent version of Play Services is to re-download the SDK platform and re-build the emulator.