Android Wear错误ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null}

前端之家收集整理的这篇文章主要介绍了Android Wear错误ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null}前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想制作一个简单的可穿戴应用程序并通过数据层连接.手持模块(使用:S5)一切正常,但可穿戴设备(使用:Moto 360)总是抛出错误

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

掌上电脑的播放服务是最新的

我已经添加

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

对于两者,手持设备,作为磨损build.gradle.

可穿戴活动:

  1. @Override
  2. protected void onCreate(Bundle savedInstanceState) {
  3. super.onCreate(savedInstanceState);
  4. setContentView(R.layout.activity_main);
  5. final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
  6. stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
  7. @Override
  8. public void onLayoutInflated(WatchViewStub stub) {
  9. mTextView = (TextView) stub.findViewById(R.id.text);
  10. }
  11. });
  12. int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
  13. Log.i(TAG,"Services available: "+ result);
  14. mGoogleApiClient = new GoogleApiClient.Builder(this)
  15. .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
  16. @Override
  17. public void onConnected(Bundle connectionHint) {
  18. Log.d(TAG,"onConnected: " + connectionHint);
  19. // Now you can use the Data Layer API
  20. }
  21. @Override
  22. public void onConnectionSuspended(int cause) {
  23. Log.d(TAG,"onConnectionSuspended: " + cause);
  24. }
  25. })
  26. .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
  27. @Override
  28. public void onConnectionFailed(ConnectionResult result) {
  29. Log.d(TAG,"onConnectionFailed: " + result);
  30. }
  31. })
  32. // Request access only to the Wearable API
  33. .addApi(Wearable.API)
  34. .build();
  35.  
  36. }
  37.  
  38. @Override
  39. protected void onStart() {
  40. super.onStart();
  41. Log.i(TAG,"==OnStart===");
  42. mGoogleApiClient.connect();
  43. }

我做过研究,但找不到任何有效的解决方案.

解决方法

当我在华硕ZenWatch上使用Google Play服务时遇到类似的问题,

在穿戴中总是抛出错误

ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_required,resolution=null

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

我发现可穿戴和手持式Google Play服务可能没有同步,我不知道为什么.

因此,请检查可穿戴的Google Play服务版本

设置 – >关于 – >软件版本

并重新同步应用程序

启动Android Wear应用 – >点击齿轮图标 – >选择您的设备 – >重新同步应用

等待3-5分钟,检查可穿戴的Google Play服务版本.

同步完成后,也许您可​​以使用它.

希望你能理解我破碎的英语.

猜你在找的Android相关文章