152

I have gone through many questions like this on Google Play, I am using Android 4.2.2 API 17.

My app requires Google play services 8.1 , It compiles fine and when it runs on emulator it shows message that 'You need to update your Google play services ' ,

When I click on update nothing happens,

How can I update the Google Play services without downloading any latest API version ?

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
Johnny
  • 1,743
  • 2
  • 10
  • 12
  • 2
    Unlikely that nothing happens. More likely is that you get an error in the run console similar to `android.content.ActivityNotFoundException: No Activity found to handle Intent...`. – Kato Oct 26 '16 at 15:59
  • 1
    As of 2017 the accepted answer is no longer correct. The advice from @user345280 regarding the tab in the emulator window should be the accepted answer. – Anthony Chuinard Nov 12 '17 at 07:50
  • I encountered on this problem few days ago and none of the answers resolved my problem. I posted my solution at the bottom, maybe it will help someone who comes here at 2019. – Ban Markovic Oct 17 '19 at 12:47

12 Answers12

93

Update On 18-Dec-2017

You can update Google Play Services via the Play Store app in your emulator just as you would on a physical Android device from API 24.

check Emulator new features added with stable update from Android Studio v 3.0

Google Play Support - From Google : We know that many app developers use Google Play Services, and it can be difficult to keep the service up to date in the Android Emulator system images. To solve this problem, we now offer versions of Android System Images that include the Play Store app. The Google Play images are available starting with Android Nougat (API 24). With these new emulator images, you can update Google Play Services via the Play Store app in your emulator just as you would on a physical Android device. Plus, you can now test end-to-end install, update, and purchase flows with the Google Play Store.


Quick Boot - Quick Boot allows you to resume your Android Emulator session in under 6 seconds

Android CTS Compatibility

Performance Improvements - With the latest versions of the Android Emulator, we now allocate RAM on demand, instead of allocating and pinning the memory to the max RAM size defined in your AVD.

Virtual sensors

Wi-Fi support

GPS location and Many more...

OR

Update this SDK Build-Tools and Android Emulator to latest and this alert message will not come again,

Settings --> Android SDK --> SDK Tools(tab) --> Android SDK Build-Tools

enter image description here

Amit Vaghela
  • 22,772
  • 22
  • 86
  • 142
  • 32
    this just doesn't work, freshly downloaded images come with out of data google play services – frankelot Feb 20 '17 at 14:05
  • check http://stackoverflow.com/a/41803959/2826147 which is fullly reversed to your comment@feresr – Amit Vaghela Feb 21 '17 at 04:41
  • Just deleted all my system images and downloaded a fresh x86_64 API 25 and still comes with google play services 9.8.79, latest one is 10.2.98 – frankelot Feb 21 '17 at 14:31
  • 1
    Ok, just re checked the linked answer.. it suggests that you download API 24 instead of 25... Which in deed comes with a somewhat "newer" google play services (10.0.84) but it's still not the latest... – frankelot Feb 21 '17 at 15:14
  • it comes with google play services so no need to worry about it. please remove your unnecessary comments so it will not confuse others.@feresr – Amit Vaghela Feb 23 '17 at 05:10
  • 4
    ? All emulators (with google APIs) come with a version google play services, the question is about how to update it to the latest version. Downloading an older API gets you a somewhat newer version, but still not the latest. (something you failed to mention on your answer) – frankelot Feb 23 '17 at 23:51
  • 6
    Please stop posting links to your answer below other people's posts. – user229044 Jul 04 '17 at 21:26
  • 3
    I had the same problem and this answer was not the solution; keep scrolling down to see one of the correct answers specifying that you must choose an image that supports Google Play - there are only 2 devices possible: Nexus5 and Nexus5X – 34m0 Jul 30 '17 at 16:41
  • 4
    Seems its missing in the latest API 27 – JPM Dec 22 '17 at 17:41
  • 11
    Doesn't seem this answer is relevant to the question as they are asking about "Android 4.2.2 API 17" but the updated answer is only relevant for API >= 24. – Liron Yahdav Feb 09 '18 at 23:26
  • 1
    Like others have mentioned this answer does not work for me. I'm using the latest Build Tools as of 4/22/2018 Build Tools 28-RC1 and latest emulator 27.1.12. My emulator complains that I need to update Google Play Services, but does not give me a way to do it. I'm using API 27 and Android 8.1 – szaske Apr 22 '18 at 07:05
  • 3
    the question is for API 17, not 24. This is notthe right answer – Leo supports Monica Cellio Jul 13 '18 at 03:02
  • @LeonardoAcevedo but this is one of the solution which can resolve issue and i have given two solutions. please check secondone. hope that helps. – Amit Vaghela Jul 13 '18 at 05:30
  • I'm sorry, but this is not the solution. – Leo Sep 04 '18 at 10:10
  • 1
    It doesn't work for API 16. I cannot create an image with Google Play Store. – André Luiz Reis Sep 25 '18 at 19:42
85

Use/ emulate a system-image that has "Play Store" pre-installed, those with "Google Play" in targets column (instead of Google APIs). Updating play services would be as easy as in real device.

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

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.

emulator settings

But even with all above (last checked 2022), you can NOT use the Emulator to test Google Play Billing:

  • You must install your application on a real device to test Google Play Billing,
  • Or, ask Google for "closed testing" permission.

see How to test In-app Billing on an emulator?

Top-Master
  • 7,611
  • 5
  • 39
  • 71
user345280
  • 1,920
  • 2
  • 18
  • 24
  • 21
    I dont' have this "Google Play" tab in my extended window. What could be the issue? – K.Os Jun 20 '17 at 12:03
  • Okey, it seems that it is only in Android Studio 3.0 version – K.Os Jun 20 '17 at 13:00
  • My emulator version is 26.0.3 – K.Os Jun 20 '17 at 14:18
  • 12
    Do you use emulator with playstore installed? Check if you have sdk manager -> sdk platforms -> Android 8 -> Google Play ... system image installed. Download it. Create new emulator using that image. – user345280 Jun 20 '17 at 15:06
  • 1
    Yes, i was not having that part installed, but now i don't have the ability to set the emulated graphics to "Software" which i need to run the emulator. It is a common problem with "waiting for device to come online". Do you have any idea how i can enable this Emulated Performance option to choose something? – K.Os Jun 21 '17 at 08:53
  • Ok, this answer has resolved my issue https://stackoverflow.com/questions/42757928/waiting-for-target-device-to-come-online-in-android-studio-2-3 – K.Os Jun 21 '17 at 09:24
  • 5
    It works on Android Studio 2.3.3. Create a New AVD, choose `Nexus 5` or `Nexus 5X` (rows with Google Play icon), press next and then Download `Android 8.0 (Google Play)` or `Android 7.0 (Google Play)`. Note the `(Google Play)` present at the SDK name. @user345280 might want to edit the answer and add this info. – Rafael Oliveira Jun 21 '17 at 22:46
  • I cannot download any app from playstore of emulator. When I click install any app, play store stop responding. – K.Sopheak Jun 28 '17 at 04:03
  • 2
    Thanks @RafaelOliveira I was trying for ages to use a Pixel and wondering why it couldn't see my Google Play image... must be a Nexus 5 or 5X! – hughjdavey Dec 25 '17 at 11:50
  • 17
    Doesn't seem this answer is relevant to the question as they are asking about "Android 4.2.2 API 17" but this answer is only relevant for API >= 24. – Liron Yahdav Feb 09 '18 at 23:27
  • @hughjdavey, it didn't help for 16-18 API. Probably https://stackoverflow.com/a/58433003/2914140 will help, I don't know. – CoolMind Dec 12 '19 at 14:39
21

You need install Google play image, Android SDK -> SDK platforms --> check show Package details --> install Google play. enter image description here

Houssin Boulla
  • 2,687
  • 1
  • 16
  • 22
18

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.

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59
  • 2
    Nice advice, but anyway you cannot use an old Play Services version to test features that require a newer version. – andreszs Jul 01 '18 at 22:34
15

Running the app on a virtual device with system image, 'Google Play API' instead of 'Google API' will solve your issue smoothly..

  • Virtual devices Nexus 5x and Nexus 5 supports 'Google Play API' image.

  • Google Play API comes with Nougat 7.1.1 and O 8.0.

Just follow the below simple steps and make sure your pc is connected to internet.

  1. Create a new virtual device by selecting Create Virtual Device(left-bottom corner) from Android Virtual Devices Manager.

  2. Select the Hardware 'Nexus 5x' or 'Nexus 5'.

  3. Download the system image 'Nougat' with Google Play or 'O' with Google Play. 'O' is the latest Android 8.0 version.

  4. Click on Next and Finish.

  5. Run your app again on the new virtual device and click on the 'Upgrade now ' option that shows along with the warning message.

  6. You will be directed to the Play Store and you can update your Google Play services easily.

See your app runs smoothly!

  • Note: If you plan to use APIs from Google Play services, you must use the Google APIs System Image.
Michel
  • 1,085
  • 13
  • 24
  • 2
    Hmm there are no `Google Play API`'s. – jlively Aug 15 '17 at 10:57
  • 1
    Thanks so much. This worked for me. I had not been able to get a login to work since upgrading to Android Studio 3.0. – pvella Dec 13 '17 at 02:47
  • 10
    Doesn't seem this answer is relevant to the question as they are asking about "Android 4.2.2 API 17" but this answer is only relevant for API >= 24. – Liron Yahdav Feb 09 '18 at 23:29
10

the answers on this page eluded me until i found the show package details option

enter image description here

abbood
  • 23,101
  • 16
  • 132
  • 246
7

My answer is not to update the Google play service but work around. Get the play service version of the emulator by using the following code

getPackageManager().getPackageInfo("com.google.android.gms", 0 ).versionName);

For example if the value is "9.8.79" then use the nearest lesser version available com.google.android.gms:play-services:9.8.0'

This will resolve your problem. Get the release history from https://developers.google.com/android/guides/releases#november_2016_-_v100

Ganesh Kanna
  • 2,269
  • 1
  • 19
  • 29
  • 1
    Can you please elaborate on what you mean by "use the nearest lesser version"? How do I "use" this? If I know that my Android Studio emulator uses version 8.0.87, then what exactly do I do with this information? Is there something in the manifest or gradle files I must set? – Marc Feb 03 '17 at 05:10
  • you can use 7.8 – Ganesh Kanna Feb 03 '17 at 05:15
3

I know it's late answer but I had same problem for last two days, and none of the above solutions worked for me. My app supports min sdk 16, Jelly Bean 4.1.x, so I wanted to test my app on emulator with 16 android api version and I needed Google Play Services.

In short, solution that worked for me is:

  • make new emulator Nexus 5X (with Play Store support) - Jelly Bean 4.1.x, 16 API level (WITHOUT Google APIs)
  • manually download apks of Google Play Store and Google Play Services (it is necessary that both apks have similar version, they need to start with same number, for example 17.x)
  • drag and drop those apks into new emulator
  • congratulations you have updated Google Play Services on your 4.1.x emulator

Here are the steps and errors I have encountered during the problem.

So I have made new emulator in my AVD. I picked Nexus 5X (with Play Store support). After that I picked Jelly Bean 16 api level (with Google APIs). When I opened my app dialog pop up with message You need to update your Google play services. When I clicked on Update button, nothing happened. I did update everything necessary in SDK manager, but nothing worked. I didn't have installed Google Play Store on my emulator, even tho I picked Nexus 5X which comes with preinstalled Play Store. So I couldn't find Google Play Store tab in Extended Controls (tree dots next to my emulator).

Because nothings worked, I decided to try to install Google Play Services manually, by downloading APK and dragging it into emulator. When I tried this, I encountered problem The APK failed to install. Error: INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES. I figured that this was the problem because I picked Jelly Bean 16 api level (with Google APIs). So I made new emulator

Nexus 5X (with Play Store support) - Jelly Bean 16 api level (WITHOUT Google APIs)

This allowed me to install my Google Play Service manually. But when I run my app, it still didn't want to open it. Problem was that my emulator was missing Google Play Store. So I installed it manually like Google Play Service. But when it was successfully installed, dialog started popping out every second with message Unfortunately Google Play Services has stopped. Problem was that version of my Google Play Store was 17.x and Google Play Service was 19.x. So at the end I installed Google Play Service with version 17.x, and everything worked.

Ban Markovic
  • 690
  • 1
  • 7
  • 12
  • How did you download and install apks? – CoolMind Dec 12 '19 at 14:19
  • @CoolMind just download them from apkmirror.com (search in google google play services apk apkmirror). When you download them, just drag and drop apk files into your emulator. – Ban Markovic Dec 17 '19 at 07:48
  • Thanks! I also thought of that, but was not sure. I will try. Did you use version 17 or more? – CoolMind Dec 17 '19 at 08:23
  • 1
    No problem, hope you will solve your problem. I used 17 version of GPS, but I think you can use any newer version you want. Here is the article with a little more information regarding my solution https://medium.com/@banmarkovic/updating-google-play-services-on-emulator-android-4-1-x-api-16-404f696830b8 – Ban Markovic Dec 17 '19 at 08:30
  • Hm, I found that 17 version is for Android 5+, so downloaded 16.8 (16.8 for x86. Android 5.0 version will write that an old SDK found). Play Market.apk installed, and GPS.apk 16.8 for armeabi-v7a installed too, but after running Play Market it writes: "Unfortunately Google Play services has stopped". Then I downloaded apks 15.1 version for x86, and after running PM nothing happened. I created an armeabi-v7a emulator and installed 16.8 versions, it was very slow. After running PM it showed white screen and closed. On x86 emulator with 17.1 versions (armeabi-v7a) PM also didn't run. – CoolMind Dec 17 '19 at 09:44
  • 1
    I'm not sure if I did understand everything u said. But I would avoid armeabi-v7a versions of apks and emulators, and will try everything with only x86 architecture (apks and emulator). – Ban Markovic Dec 17 '19 at 11:24
  • Yes, x86 are better, armeabi-v7a were very slow. If you have spare time, could you update the article with the links to apks and chosen architecture/dpi? Thank you. – CoolMind Dec 17 '19 at 11:36
  • Finally an answer that actually answers the question (API 17). I'm amazed at how many upvotes all the incorrect answers have. – btraas Feb 20 '21 at 08:14
0

I faced the same issue. I updated my Android studio and used API 25 target as Android 7.1.1 and X86 and everything worked fine. I use Google play services and firebase for my project

Mahesh N
  • 772
  • 1
  • 10
  • 21
0

I was having the same issue. Just avoid using an emulator with SDK 27. SDK 26 works fine!

Estevão Lucas
  • 4,440
  • 34
  • 37
-1

2020 , the error Google Play services out of date. Requires 12451000 but found 11743470

just update Google Play services from the Google Play after you sing-in with a valid account.

PS: I've tried different Emulator versions, but all required to update google play services.

Bogdan M
  • 9
  • 3
-1

Update your google play services or just create the new emulator. When you install the new emulator this problem will automatically be solved. Happy coding :)

Muhammad Tameem Rafay
  • 3,602
  • 2
  • 21
  • 32