GooglePlayServicesUtil: Google Play services are deprecated. Required 5089000 but found 5077534

I am having problem updating SDK for Google Play-Services.

My apps build and run (as before) - but on Android wear watch, this message is in the logs:

GooglePlayServicesUtil: Google Play services are deprecated. Required 5089000 but found 5077534

So, the application compiles with 5.0.89, but the watch has version 5.0.77.

Communication between watch and phone is now failing (it worked before).

How do I make my application backward compatible with earlier versions of google-play services, given that Android Studio does not provide a way to revert to earlier versions of google-play services?

This is 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 to force Android Studio to use version 5.0.77, it complains about the build:

Error: could not find: com.google.android.gms: play-services: 5.0.77

How can I stay compatible with my watch with earlier versions of Google Play Services?

+3


source to share


2 answers


To build the downloadable side, you need to update build.gradle to use game services, not just game services as shown above.

So if you look at one of the examples, like the 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 a request for an early mention in the official documentation.

+5


source


This happens when your mobile has the old play service and you are using the new play service library. so all you need is 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 a popup if there is any problem getting the game service.

+3


source







All Articles