简体   繁体   中英

Android Wear Emulator show Error SERVICE_VERSION_UPDATE_REQUIRED for Google Play services

I am testing android wear app on Wear Emulator and using eclipse to develop.

In wear app there are code as below in onCreate:

mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener()
{
    @Override
    public void onConnectionFailed(ConnectionResult result)
    {
    Log.d(TAG, "onConnectionFailed: " + result);
    }
}).addApi(Wearable.API).build();
mGoogleApiClient.connect();

When I run this on Wear emulator I got error as below:

W/GooglePlayServicesUtil(1809): Google Play services out of date.  Requires 5089000 but found 5077534
D/WearApp(1809): onConnectionFailed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null}

If any one have solution or tips for that then please let me know.

Thanks!

I believe I had the same error.

If your build.gradle is:

compile 'com.google.android.gms:play-services:+'

change it to:

compile 'com.google.android.gms:play-services:5.0.89'

that's because Google didn't completely roll out the latest play services to devices, but it's already available to developers. As an alternative solution, you can check if there's an update to the WearEmulator on the SDK Manager.

If you look in your build.gradle file, you are probably using play-services. You need to use play-services-wearable instead, which has the correct version.

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

If you are using Eclipse, you need to ensure you unpack the play-services-wearable AAR file and not the standard mobile play-services AAR file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM