在模拟器中更新 Google 播放服务
updating Google play services in Emulator
我在Google Play上经历过很多这样的问题,我正在使用Android 4.2.2 API 17。
我的应用程序需要 Google 播放服务 8.1,它编译正常,当它在模拟器上运行时它显示消息 'You need to update your Google play services ',
当我点击更新时没有任何反应,
如何在不下载任何最新 API 版本的情况下更新 Google Play 服务?
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.
尝试在模拟器中导航至设置--> 应用,然后找到 Google Play 服务。查看版本号,用在你build.gradle。要使用最新版本更新它,您可以在这些 documentation and SO question.
中看到它
2017 年 12 月 18 日更新
您可以通过模拟器中的 Play 商店应用程序更新 Google Play 服务,就像在 Android 物理设备上一样 [=39] =] 24.
使用来自 Android Studio v 3.0
的稳定更新检查 Emulator new features added
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...
或
将此 SDK 构建工具和 Android 模拟器更新到最新版本,此警告消息将不会再次出现,
Settings --> Android SDK --> SDK Tools(tab) --> Android SDK
Build-Tools
我的回答不是更新 Google 播放服务,而是变通。
使用以下代码获取模拟器播放服务版本
getPackageManager().getPackageInfo("com.google.android.gms", 0 ).versionName);
例如,如果值为“9.8.79”,则使用最接近的可用版本 com.google.android.gms:play-services:9.8.0'
这将解决您的问题。从 https://developers.google.com/android/guides/releases#november_2016_-_v100
获取发布历史
我遇到了同样的问题。我更新了我的 Android 工作室并使用 API 25 目标作为 Android 7.1.1 和 X86,一切正常。我为我的项目使用 Google 播放服务和 firebase
使用安装了 Play 商店的模拟器。更新播放服务就像在真实设备中一样简单。
自 Google 引入 Google Play Store images in Android SDK Tools 26.0.0 now emulators comes with installed Google Play Store。
自 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.
运行将应用程序安装在具有系统映像的虚拟设备上,'Google Play API' 而不是 'Google API' 将顺利解决您的问题..
虚拟设备 Nexus 5x 和 Nexus 5 支持 'Google Play API' 图片。
Google Play API 带有 Nougat 7.1.1 和 O 8.0。
只需按照以下简单步骤操作,并确保您的电脑已连接到互联网。
通过从 Android 虚拟设备管理器中选择创建虚拟设备(左下角)来创建一个新的虚拟设备。
Select 硬件 'Nexus 5x' 或 'Nexus 5'.
通过 Google Play 下载系统映像 'Nougat' 或通过 Google Play 下载系统映像 'O'。 'O' 是最新的 Android 8.0 版本。
单击下一步并完成。
运行 再次在新的虚拟设备上运行您的应用程序,然后单击随警告消息一起显示的 'Upgrade now ' 选项。
您将被引导至 Play 商店,您可以轻松更新 Google Play 服务。
看到您的应用运行流畅!
- 注意:如果您打算使用 Google Play 服务中的 APIs,则必须使用 Google APIs 系统映像。
我遇到了同样的问题。只是避免使用带有 SDK 27 的模拟器。SDK 26 工作正常!
您需要安装Google播放图像,
Android SDK -> SDK 平台 --> 检查显示包详细信息 --> 安装 Google 播放。
直到我找到显示包裹详细信息选项
,我才发现此页面上的答案
我知道这是迟到的答案,但我在过去两天遇到了同样的问题,上述解决方案中的 none 对我有用。我的应用程序支持 min sdk 16,Jelly Bean 4.1.x,所以我想在模拟器上测试我的应用程序 16 android api 版本和我需要 Google Play 服务。
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
下面是我做题过程中遇到的步骤和错误。
所以我在我的 AVD 中制作了新的模拟器。我选择了 Nexus 5X(支持 Play Store)。之后,我选择了 Jelly Bean 16 api 级别(使用 Google API)。当我打开我的应用程序对话框时弹出消息 您需要更新您的 Google 播放服务 。当我点击更新按钮时,没有任何反应。我确实更新了 SDK 管理器中的所有必要内容,但没有任何效果。我没有在我的模拟器上安装 Google Play Store,即使我选择了预装 Play Store 的 Nexus 5X。所以我在扩展控件中找不到 Google Play Store 选项卡(我的模拟器旁边的树点)。
因为没有任何效果,我决定尝试手动安装 Google Play 服务,方法是下载 APK 并将其拖到模拟器中。当我尝试这样做时,我遇到了问题 APK 安装失败。错误:INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES。我认为这是问题所在,因为我选择了 Jelly Bean 16 api 级别 (使用 Google API)。所以我制作了新的模拟器
Nexus 5X (with Play Store support) - Jelly Bean 16 api level (WITHOUT
Google APIs)
这让我可以手动安装 Google Play 服务。但是当我 运行 我的应用程序时,它仍然不想打开它。问题是我的模拟器缺少 Google Play Store。所以我像 Google Play Service 一样手动安装了它。但是当它成功安装时,对话框开始每秒弹出消息不幸的是Google Play 服务已停止。问题是我的 Google Play 商店的版本是 17.x 并且 Google Play 服务是 19.x。所以最后我安装了 Google 版本 17.x 的 Play 服务,一切正常。
2020 , the error
Google Play services out of date. Requires 12451000 but found 11743470
只需更新 Google 从 Google Play 使用有效帐户登录后播放服务。
PS: 我尝试过不同的模拟器版本,但都需要更新 google 播放服务。
更新您的 google 播放服务 或只是创建新的模拟器。
当您安装新的模拟器时,这个问题会自动解决。
编码愉快:)
我在Google Play上经历过很多这样的问题,我正在使用Android 4.2.2 API 17。
我的应用程序需要 Google 播放服务 8.1,它编译正常,当它在模拟器上运行时它显示消息 'You need to update your Google play services ',
当我点击更新时没有任何反应,
如何在不下载任何最新 API 版本的情况下更新 Google Play 服务?
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.
尝试在模拟器中导航至设置--> 应用,然后找到 Google Play 服务。查看版本号,用在你build.gradle。要使用最新版本更新它,您可以在这些 documentation and SO question.
中看到它2017 年 12 月 18 日更新
您可以通过模拟器中的 Play 商店应用程序更新 Google Play 服务,就像在 Android 物理设备上一样 [=39] =] 24.
使用来自 Android Studio v 3.0
的稳定更新检查 Emulator new features addedGoogle 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...
或
将此 SDK 构建工具和 Android 模拟器更新到最新版本,此警告消息将不会再次出现,
Settings --> Android SDK --> SDK Tools(tab) --> Android SDK Build-Tools
我的回答不是更新 Google 播放服务,而是变通。 使用以下代码获取模拟器播放服务版本
getPackageManager().getPackageInfo("com.google.android.gms", 0 ).versionName);
例如,如果值为“9.8.79”,则使用最接近的可用版本 com.google.android.gms:play-services:9.8.0'
这将解决您的问题。从 https://developers.google.com/android/guides/releases#november_2016_-_v100
获取发布历史我遇到了同样的问题。我更新了我的 Android 工作室并使用 API 25 目标作为 Android 7.1.1 和 X86,一切正常。我为我的项目使用 Google 播放服务和 firebase
使用安装了 Play 商店的模拟器。更新播放服务就像在真实设备中一样简单。
自 Google 引入 Google Play Store images in Android SDK Tools 26.0.0 now emulators comes with installed Google Play Store。
自 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.
运行将应用程序安装在具有系统映像的虚拟设备上,'Google Play API' 而不是 'Google API' 将顺利解决您的问题..
虚拟设备 Nexus 5x 和 Nexus 5 支持 'Google Play API' 图片。
Google Play API 带有 Nougat 7.1.1 和 O 8.0。
只需按照以下简单步骤操作,并确保您的电脑已连接到互联网。
通过从 Android 虚拟设备管理器中选择创建虚拟设备(左下角)来创建一个新的虚拟设备。
Select 硬件 'Nexus 5x' 或 'Nexus 5'.
通过 Google Play 下载系统映像 'Nougat' 或通过 Google Play 下载系统映像 'O'。 'O' 是最新的 Android 8.0 版本。
单击下一步并完成。
运行 再次在新的虚拟设备上运行您的应用程序,然后单击随警告消息一起显示的 'Upgrade now ' 选项。
您将被引导至 Play 商店,您可以轻松更新 Google Play 服务。
看到您的应用运行流畅!
- 注意:如果您打算使用 Google Play 服务中的 APIs,则必须使用 Google APIs 系统映像。
我遇到了同样的问题。只是避免使用带有 SDK 27 的模拟器。SDK 26 工作正常!
您需要安装Google播放图像,
Android SDK -> SDK 平台 --> 检查显示包详细信息 --> 安装 Google 播放。
直到我找到显示包裹详细信息选项
,我才发现此页面上的答案我知道这是迟到的答案,但我在过去两天遇到了同样的问题,上述解决方案中的 none 对我有用。我的应用程序支持 min sdk 16,Jelly Bean 4.1.x,所以我想在模拟器上测试我的应用程序 16 android api 版本和我需要 Google Play 服务。
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
下面是我做题过程中遇到的步骤和错误。
所以我在我的 AVD 中制作了新的模拟器。我选择了 Nexus 5X(支持 Play Store)。之后,我选择了 Jelly Bean 16 api 级别(使用 Google API)。当我打开我的应用程序对话框时弹出消息 您需要更新您的 Google 播放服务 。当我点击更新按钮时,没有任何反应。我确实更新了 SDK 管理器中的所有必要内容,但没有任何效果。我没有在我的模拟器上安装 Google Play Store,即使我选择了预装 Play Store 的 Nexus 5X。所以我在扩展控件中找不到 Google Play Store 选项卡(我的模拟器旁边的树点)。
因为没有任何效果,我决定尝试手动安装 Google Play 服务,方法是下载 APK 并将其拖到模拟器中。当我尝试这样做时,我遇到了问题 APK 安装失败。错误:INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES。我认为这是问题所在,因为我选择了 Jelly Bean 16 api 级别 (使用 Google API)。所以我制作了新的模拟器
Nexus 5X (with Play Store support) - Jelly Bean 16 api level (WITHOUT Google APIs)
这让我可以手动安装 Google Play 服务。但是当我 运行 我的应用程序时,它仍然不想打开它。问题是我的模拟器缺少 Google Play Store。所以我像 Google Play Service 一样手动安装了它。但是当它成功安装时,对话框开始每秒弹出消息不幸的是Google Play 服务已停止。问题是我的 Google Play 商店的版本是 17.x 并且 Google Play 服务是 19.x。所以最后我安装了 Google 版本 17.x 的 Play 服务,一切正常。
2020 , the error Google Play services out of date. Requires 12451000 but found 11743470
只需更新 Google 从 Google Play 使用有效帐户登录后播放服务。
PS: 我尝试过不同的模拟器版本,但都需要更新 google 播放服务。
更新您的 google 播放服务 或只是创建新的模拟器。 当您安装新的模拟器时,这个问题会自动解决。 编码愉快:)