在模拟器中更新谷歌播放服务

时间:2021-04-15 15:22:28

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

我在谷歌上遇到过很多这样的问题,我使用的是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 ' ,

我的应用程序需要谷歌play服务8.1,它编译的很好,当它在模拟器上运行时,它显示了“你需要更新谷歌游戏服务”的信息,

When I click on update nothing happens,

当我点击更新时什么都没有发生,

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

如何在不下载任何最新API版本的情况下更新谷歌播放服务?

8 个解决方案

#1


64  

Update On 18-Dec-2017

更新18日- 12月- 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.

您可以通过模拟器中的Play Store应用程序更新谷歌Play服务,就像您在API 24中的物理Android设备上所做的那样。

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

检查模拟器的新特性,从Android Studio v3.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.

谷歌播放支持——来自谷歌:我们知道许多应用程序开发人员都使用谷歌播放服务,在Android仿真器系统映像中很难保持该服务的最新。为了解决这个问题,我们现在提供包括Play Store应用的Android系统镜像版本。谷歌的Play镜像可以从Android Nougat (API 24)开始使用。有了这些新的仿真器映像,您可以通过仿真器中的Play Store应用程序更新谷歌Play服务,就像在物理Android设备上一样。此外,您现在可以使用谷歌Play存储测试端到端安装、更新和购买流。


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

快速引导-快速引导允许您在6秒内恢复您的Android模拟器会话

Android CTS Compatibility

Android CTS兼容性

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.

性能改进——使用最新版本的Android仿真器,我们现在根据需要分配RAM,而不是将内存分配和固定到AVD中定义的最大RAM大小。

Virtual sensors

虚拟传感器

Wi-Fi support

无线网络支持

GPS location and Many more...

GPS定位和更多……

OR

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

更新这个SDK构建工具和Android模拟器到最新,这个警告消息不会再出现,

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

设置——> Android SDK > SDK工具(tab)——> Android SDK构建工具

在模拟器中更新谷歌播放服务

#2


57  

Use emulator that has Play Store installed. Updating play services would be as easy as in real device.

使用安装了Play Store的模拟器。更新play服务将和在真实设备中一样简单。

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

由于谷歌在Android SDK工具26.0.0中引入了谷歌Play Store镜像,现在模拟器自带谷歌Play Store。

在模拟器中更新谷歌播放服务

From 26.0.3

从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.
  • 在扩展窗口中为谷歌Play Store映像添加一个新选项卡,显示Play服务版本和一个按钮,用于检查Play服务的更新。

在模拟器中更新谷歌播放服务

#3


15  

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.

如果您想在模拟器上测试应用程序,请展开Android 4.2.2 (API 17)或更高版本的目录,选择谷歌API并安装它。然后以谷歌api为平台目标创建一个新的AVD。

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.

尝试导航到设置——模拟器中的>应用程序,然后找到谷歌播放服务。检查版本号并在您的build.gradle中使用它。要用最新版本更新它,可以在这些文档中看到。

#4


12  

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

使用系统镜像在虚拟设备上运行app,“谷歌Play API”而不是“谷歌API”会很好地解决你的问题。

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

    虚拟设备Nexus 5x和Nexus 5支持“谷歌Play API”图像。

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

    谷歌Play API与Nougat 7.1.1和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.

    通过从Android虚拟设备管理器中选择Create virtual device(左下角)创建一个新的虚拟设备。

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

    选择硬件“Nexus 5x”或“Nexus 5”。

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

    下载系统图像'Nougat'与谷歌播放或'O'与谷歌播放。“O”是最新的Android 8.0版本。

  4. Click on Next and Finish.

    点击Next完成。

  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.
  • 注意:如果您打算使用来自谷歌Play服务的api,您必须使用谷歌api系统映像。

#5


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

我的答案不是更新谷歌play服务,而是围绕它工作。使用以下代码获取仿真器的播放服务版本

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'

例如,如果值是“9.8.79”,那么使用最近的可用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

这将解决你的问题。从https://developers.google.com/android/guides/release #november_2016_-_v100获取发布历史

#6


4  

You need install Google play image, Android SDK -> SDK platforms --> check show Package details --> install Google play. 在模拟器中更新谷歌播放服务

你需要安装谷歌播放镜像,Android SDK——> SDK平台——>查看包细节——>安装谷歌play。

#7


1  

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

我也有同样的问题。避免使用SDK 27的仿真器。SDK 26没问题!

#8


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

我面临着同样的问题。我更新了我的Android studio,并使用了API 25作为Android 7.1.1和X86的目标,一切都很好。我的项目使用谷歌播放服务和firebase

#1


64  

Update On 18-Dec-2017

更新18日- 12月- 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.

您可以通过模拟器中的Play Store应用程序更新谷歌Play服务,就像您在API 24中的物理Android设备上所做的那样。

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

检查模拟器的新特性,从Android Studio v3.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.

谷歌播放支持——来自谷歌:我们知道许多应用程序开发人员都使用谷歌播放服务,在Android仿真器系统映像中很难保持该服务的最新。为了解决这个问题,我们现在提供包括Play Store应用的Android系统镜像版本。谷歌的Play镜像可以从Android Nougat (API 24)开始使用。有了这些新的仿真器映像,您可以通过仿真器中的Play Store应用程序更新谷歌Play服务,就像在物理Android设备上一样。此外,您现在可以使用谷歌Play存储测试端到端安装、更新和购买流。


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

快速引导-快速引导允许您在6秒内恢复您的Android模拟器会话

Android CTS Compatibility

Android CTS兼容性

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.

性能改进——使用最新版本的Android仿真器,我们现在根据需要分配RAM,而不是将内存分配和固定到AVD中定义的最大RAM大小。

Virtual sensors

虚拟传感器

Wi-Fi support

无线网络支持

GPS location and Many more...

GPS定位和更多……

OR

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

更新这个SDK构建工具和Android模拟器到最新,这个警告消息不会再出现,

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

设置——> Android SDK > SDK工具(tab)——> Android SDK构建工具

在模拟器中更新谷歌播放服务

#2


57  

Use emulator that has Play Store installed. Updating play services would be as easy as in real device.

使用安装了Play Store的模拟器。更新play服务将和在真实设备中一样简单。

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

由于谷歌在Android SDK工具26.0.0中引入了谷歌Play Store镜像,现在模拟器自带谷歌Play Store。

在模拟器中更新谷歌播放服务

From 26.0.3

从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.
  • 在扩展窗口中为谷歌Play Store映像添加一个新选项卡,显示Play服务版本和一个按钮,用于检查Play服务的更新。

在模拟器中更新谷歌播放服务

#3


15  

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.

如果您想在模拟器上测试应用程序,请展开Android 4.2.2 (API 17)或更高版本的目录,选择谷歌API并安装它。然后以谷歌api为平台目标创建一个新的AVD。

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.

尝试导航到设置——模拟器中的>应用程序,然后找到谷歌播放服务。检查版本号并在您的build.gradle中使用它。要用最新版本更新它,可以在这些文档中看到。

#4


12  

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

使用系统镜像在虚拟设备上运行app,“谷歌Play API”而不是“谷歌API”会很好地解决你的问题。

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

    虚拟设备Nexus 5x和Nexus 5支持“谷歌Play API”图像。

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

    谷歌Play API与Nougat 7.1.1和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.

    通过从Android虚拟设备管理器中选择Create virtual device(左下角)创建一个新的虚拟设备。

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

    选择硬件“Nexus 5x”或“Nexus 5”。

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

    下载系统图像'Nougat'与谷歌播放或'O'与谷歌播放。“O”是最新的Android 8.0版本。

  4. Click on Next and Finish.

    点击Next完成。

  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.
  • 注意:如果您打算使用来自谷歌Play服务的api,您必须使用谷歌api系统映像。

#5


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

我的答案不是更新谷歌play服务,而是围绕它工作。使用以下代码获取仿真器的播放服务版本

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'

例如,如果值是“9.8.79”,那么使用最近的可用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

这将解决你的问题。从https://developers.google.com/android/guides/release #november_2016_-_v100获取发布历史

#6


4  

You need install Google play image, Android SDK -> SDK platforms --> check show Package details --> install Google play. 在模拟器中更新谷歌播放服务

你需要安装谷歌播放镜像,Android SDK——> SDK平台——>查看包细节——>安装谷歌play。

#7


1  

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

我也有同样的问题。避免使用SDK 27的仿真器。SDK 26没问题!

#8


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

我面临着同样的问题。我更新了我的Android studio,并使用了API 25作为Android 7.1.1和X86的目标,一切都很好。我的项目使用谷歌播放服务和firebase