Android Studio Emulator Google Play Services

I am trying to get the last known location in my Android emulator from Android Studio by following this guide https://developer.android.com/training/location/retrieve-current.html

However, the onConnectionFailed callback method is called using error code: 2 . When I show the error dialog in my emulator, it says:

Update Google Play Services

{app_name} will not work unless you upgrade your Google Play services.

UPDATE

when I click the UPDATE button, an error message appears:

E / SettingsRedirect: Unable to redirect application settings for Google Play services

I think the problem is that Google Play services are not included in the emulator. I also tried answering Android Studio with Google Play services here, but that didn't work.

The Google documentation says:

To test the application using the Google Play Services SDK, you must use either:

1.) A compatible Android device running Android 2.3 or later and includes the Google Play Store.

2.) Android emulator with AVD, which launches the Google API platform based on> Android 4.2.2 or later.

Can someone tell me how to make point 2? My AVD Nexus 5 API 22 x86

+4
source share
1 answer

Here, version 4.2.2 means that it must comply with API level 17 and higher. Therefore, your AVD should be in order. Alternatively, you can download the Google Play Services APK and install it through the ADB shell. See this one for more information.

However, even if the problem with Play Services is resolved, you cannot receive location updates in the emulator, since it does not have GPS equipment. You can model the behavior of a location using the geo command, as described here .

0
source

All Articles