Android模拟器已经过时了Google Play服务

f.k*_*sis 5 android-emulator google-play-services

最新的Google Play服务版本为9.2.0但Android模拟器的Google Play服务版仅为9.0.80

因此,您无法在模拟器上运行使用9.2.0编译的应用程序.例如,MapView显示'此应用程序无法运行.请更新Google Play服务"

除了将应用程序依赖项更改为9.0.2之外的任何解决方法?

And*_*ast -1

将 Google Play 服务添加到您的项目中,添加dependencies最新版本的play-services.

apply plugin: 'com.android.application'
...

dependencies {
compile 'com.google.android.gms:play-services:9.2.0'
}
Run Code Online (Sandbox Code Playgroud)

请务必在每次更新 Google Play 服务时更新此版本号。

如Google Play 服务概述中所述,Google Play 通过 Google Play 商店应用为 Android 2.3 及更高版本的用户提供服务更新。但是,更新可能不会立即到达所有用户,因此您的应用程序应在尝试执行 API 事务之前验证可用的版本。

强烈建议您使用GoogleApiClient类来访问 Google Play 服务功能。这种方法允许您将一个对象附加OnConnectionFailedListener到您的客户端。要检测设备是否具有适当版本的 Google Play 服务 APK,请实现onConnectionFailed()回调方法。如果由于 Google Play APK 版本缺失或过时而导致连接失败,则回调会收到错误代码,SERVICE_MISSING例如SERVICE_VERSION_UPDATE_REQUIREDSERVICE_DISABLED

  • 您混淆了模拟器上的 Google Play 服务库和 Google Play 服务应用程序。重点是,如果添加依赖项 9.2.0,模拟器将无法工作。 (2认同)