GooglePlayServicesUtil: Google Play services out of date. Requires 5089000 but found 5077534

我的梦境 提交于 2019-12-01 23:30:57

问题


I have a problem with an update to the google-play-services SDK.

My app builds and runs (as it did before) - but on the Android wear watch, this message is in the logs:

GooglePlayServicesUtil﹕ Google Play services out of date. Requires 5089000 but found 5077534

So the app is compiling with 5.0.89 but the watch only has version 5.0.77.

The communication between the watch and the phone now fails (it had worked previously).

How would I make the app backwards compatible with earlier versions of google-play-services given that Android Studio doesn't provide a way to go back to earlier versions of google-play-services?

These are the gradle settings for the wear app

dependencies {
   compile 'com.google.android.gms:play-services:5.0.+@aar'
   compile "com.android.support:support-v13:20.0.+"
   compile "com.google.android.support:wearable:1.0.+"
}

If I try and force Android Studio to use version 5.0.77 it complains in the build:

Error:Failed to find: com.google.android.gms:play-services:5.0.77

How can I remain compatible with watches with earlier versions of Google play services?


回答1:


The build.gradle on the wearable side needs to be updated to use play-services-wearable instead of just play-services like you have shown above.

So if you look at one of the samples like DataLayer provided in the Wear SDK, it uses something like this in wearable/build.gradle:

dependencies {
    compile 'com.google.android.gms:play-services-wearable:+'
}

I have put in a request to get this mentioned in the official documentation soon.




回答2:


This happens when your mobile has old play-service and you are using new play-service lib. so all you need to update your google-play-service from your phone.

You can use

int googleServiceStatus = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    Dialog dialog = GoogleApiAvailability.getInstance().getErrorDialog(this,googleServiceStatus, 10);
    if(dialog!=null){
        dialog.show();
    }

this will show popup in case of any problem to get play-service.



来源:https://stackoverflow.com/questions/25197887/googleplayservicesutil-google-play-services-out-of-date-requires-5089000-but-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!