Android Wear Error ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null}

允我心安 提交于 2019-12-01 16:46:21

问题


I've wanted to make an easy wearable app and connect through the data layer. Everything works fine with the handheld module (using: S5), but the wearable (using: Moto 360) always throw the error:

onConnectionFailed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null}

The play services at the handheld are up-to-date

I've added

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

to both, the handheld, as the wear build.gradle.

The wearable Activity:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
        stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
            @Override
            public void onLayoutInflated(WatchViewStub stub) {
                mTextView = (TextView) stub.findViewById(R.id.text);
            }
        });
        int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        Log.i(TAG,"Services available: "+ result);
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
                    @Override
                    public void onConnected(Bundle connectionHint) {
                        Log.d(TAG, "onConnected: " + connectionHint);
                        // Now you can use the Data Layer API
                    }
                    @Override
                    public void onConnectionSuspended(int cause) {
                        Log.d(TAG, "onConnectionSuspended: " + cause);
                    }
                })
                .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
                    @Override
                    public void onConnectionFailed(ConnectionResult result) {
                        Log.d(TAG, "onConnectionFailed: " + result);
                    }
                })
                        // Request access only to the Wearable API
                .addApi(Wearable.API)
                .build();

    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.i(TAG, "==OnStart===");
        mGoogleApiClient.connect();
    }

I've done research, but I couldn't find any working solution.


回答1:


I have a similar problem when I use Google Play Services on ASUS ZenWatch,

In wearable always throw error:

ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null

Google Play services out of date. Requires 7327000 but found 6774534

I found wearable and handheld Google Play Services may be not syncing, I don't know why.

enter image description here

So, check wearable Google Play Services version

Settings -> About -> Software version

And resync apps

Launch Android Wear app -> Click the gear icon -> select your device -> Resync apps

Wait 3-5 minute , check wearable Google Play Services version.

When sync is complete, maybe you can work it.

Hope you understand my broken English.

|improve this answer

来源:https://stackoverflow.com/questions/30171361/android-wear-error-connectionresultstatuscode-service-version-update-required

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