Android Wear Emulator show Error SERVICE_VERSION_UPDATE_REQUIRED for Google Play services

北慕城南 提交于 2019-12-11 03:23:41

问题


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!


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/25685873/android-wear-emulator-show-error-service-version-update-required-for-google-play

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