我使用这种方法来检查播放服务的可用性:
private boolean checkPlayServices() {
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (status != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(status)) {
showErrorDialog(status);
} else {
Toast.makeText(this, "This device is not supported.", Toast.LENGTH_LONG).show();
finish();
}
return false;
}
return true;
}
status
现在在我运行应用程序时设置为 2,这表明已安装的播放服务需要更新,即使播放商店中没有播放服务的更新。
isUserRecoverableError
调用的对话框显示:
Update Google Play services - This app won't run unless you update Google Play services
这是在我通过 SDK 管理器更新我的 Android SDK 之后发生的,该 SDK 管理器更新了“Google 存储库”(如果我没记错的话,不是“Google Play 服务”,尽管昨天更新没有任何问题)。
Android Studio 告诉我播放服务版本是 5.2.08。
我能做什么?例如,我可以在依赖项部分强制使用较低版本吗?
compile 'com.google.android.gms:play-services:+'
最佳答案
最初发表在问题中
我指定了我记得在 app/build.gradle
中看到的以前的版本,我的应用现在运行良好:
compile 'com.google.android.gms:play-services:5.0.89'
关于android - Google Play 服务版本 5.2.08 对我的设备来说太新了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25198291/