Google Play 服务与 Android 4.0.4 不兼容
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25984266/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Google Play Services incompatible for Android 4.0.4
提问by dtrejogo
I'm building an app using google map v2, it requires google play services, so I added this validation to check for it:
我正在使用谷歌地图 v2 构建一个应用程序,它需要谷歌播放服务,所以我添加了这个验证来检查它:
int checkGooglePlayServices = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(myContext);
if (checkGooglePlayServices != ConnectionResult.SUCCESS) {
// google play services is missing!!!!
/*
* Returns status code indicating whether there was an error.
* Can be one of following in ConnectionResult: SUCCESS,
* SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED,
* SERVICE_DISABLED, SERVICE_INVALID.
*/
GooglePlayServicesUtil.getErrorDialog(checkGooglePlayServices,
myContext, REQUEST_CODE_RECOVER_PLAY_SERVICES).show();
}
So it turns out I have a device 4.0.4 that didn't come with google play services (why? I dont know, but it has gmail, and maps working fine), when I run the app the validation works and takes me to play store to install/update google play services, however the page says: Your device isn't compatible with this version.
所以事实证明我有一个设备 4.0.4 没有附带 google play 服务(为什么?我不知道,但它有 gmail,地图工作正常),当我运行应用程序时,验证工作并带我去Play 商店安装/更新 google play 服务,但页面显示:您的设备与此版本不兼容。
So how do I install google play service if it is not available on play store? is it common to have android devices without this app ?
那么,如果 Google Play 服务在 Play 商店中不可用,我该如何安装?没有这个应用程序的安卓设备很常见吗?
thanks,
谢谢,
回答by ashoke
The error seems to suggest the play services version on your device is not compatible with the play services library used by your app. Where does it say the play services is not available on your device.
To make sure the play services in running on your device, and to find out its version, look in
Settings -> Apps -> Downloaded -> Google Play Services
该错误似乎表明您设备上的播放服务版本与您的应用使用的播放服务库不兼容。它在哪里说您的设备上没有播放服务。
要确保播放服务在您的设备上运行,并找出其版本,请查看
Settings -> Apps -> Downloaded -> Google Play Services
Since it is not giving you an option to update the play services on device, I would consider using a matching play services client library in your app. You can easily do this on Android studio build.gradle of the app module by adding exact version to your dependencies like so
dependencies { compile 'com.google.android.gms:play-services:5.0.89' }
replace
5.0.89
with the version you find on your device.
由于它没有为您提供更新设备上播放服务的选项,我会考虑在您的应用程序中使用匹配的播放服务客户端库。您可以在应用模块的 Android studio build.gradle 上轻松执行此操作,方法是将确切版本添加到您的依赖项中,如下所示
dependencies { compile 'com.google.android.gms:play-services:5.0.89' }
替换
5.0.89
为您在设备上找到的版本。