16

Hi I am trying to run an Android Program I have created that can connect to Firebase with Authentication using email and password but it seems that I cannot even authenticate due to the fact of them saying my Google Play Service is not up to date.

enter image description here

I am stump here as I have the latest google play services according to my SDK manager

enter image description here

and I don't think it is my code's problem as when I use my friend's phone for debugging it works but not when I am using the emulator.

How can I update my google play services in the Android Studio built-in emulator.

Community
  • 1
  • 1
Annonymous177
  • 563
  • 2
  • 10
  • 21
  • Have you tried to do it inside the Emulator like on a real phone? (Settings -> Apps -> Google Play Services -> Install Updates) I can't check it, because my AMD 3.4 Ghz seems to be too slow for running this crap. It takes 30 minutes to start the emulator itself. – Bevor Oct 04 '16 at 09:15
  • @Bevor Nope the emulator doesn't seem to have Install updates option for me to select – Annonymous177 Oct 04 '16 at 10:06
  • Possible duplicate of [updating Google play services in Emulator](https://stackoverflow.com/questions/35476182/updating-google-play-services-in-emulator) – Amit Vaghela Dec 19 '17 at 05:42

4 Answers4

20

Since Google introduced Google Play Store images in Android SDK Tools 26.0.0 now emulators comes with installed Google Play Store.

When creating Emulator use images that support Google Playstore (currently Nexus 5 and Nexus 5x with android O)

enter image description here

From 26.0.3

  • Adds a new tab in the extended window for Google Play Store images that displays the Play Services version and a button to check for updates to Play Services.

Edit: Make sure that you use emulator with playstore is installed. Check if you have sdk manager -> sdk platforms -> Android 8 -> Google Play ... system image installed. Download it. Create new emulator using that image.

emulator settings

user345280
  • 1,920
  • 2
  • 18
  • 24
  • 11
    I have v26.1.4 of the emulator and no Google Play tab is displayed even though my AVD has an icon in the play store column – buss Sep 09 '17 at 20:35
  • @buss You also need to install a Google Play system image (when selecting system image, go to "Recommended" tab). It seems that only API 24 to 27 are supported so far. – FlorianT Oct 29 '17 at 11:36
  • Say if I have a Jenkins job that creates an AVD every time the connectedAndroidTest is being ran, how would I do such update via shell? – benChung Nov 13 '19 at 04:25
2

I had the same issue and spent half a day working it out.

In your emulator, go to settings->apps->Google Play Services and compare the version used to what appears in your build.gradle file.

In my case the emulator was running an earlier version and no amount of updates seemed to change it.

In build.gradle, I changed the following:

compile 'com.google.android.gms:play-services:9.6.1' 

to

compile 'com.google.android.gms:play-services:8.+'

After which I restarted android-studio and it worked flawlessly.

kranit
  • 29
  • 1
1

Try to download and install the latest APK for Play Services as stated in this thread.

Based from Google documentation,

If you want to test your app on the emulator, expand the directory for Android 4.2.2 (API 17) or a higher version, select Google APIs, and install it. Then create a new AVD with Google APIs as the platform target.

Try to navigate to settings--> apps in your emulator and then find Google Play Services. Check the version number and use it in you build.gradle. To update it with the latest version, you can see it in these documentation and SO question.

Be noted that updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.

Community
  • 1
  • 1
adjuremods
  • 2,938
  • 2
  • 12
  • 17
1

I was facing same issue, but i downgrade my play services version in build.gradle.

  1. settings->apps->Google Play Services application check image
  2. my google play services version is 10.2.98, that's why we need google-play-services(in module level build.gradle) version lower than our emulator's library version.
  3. set the lower version from here, we can see 10.2.6 is better and set it in build.gradle like this compile 'com.google.android.gms:play-services-places:10.2.6' and just simple, run app again.