7

我想製作一個簡單的穿戴式應用程序並通過數據層進行連接。一切工作正常與手持模塊(使用:S5),但可穿戴(使用:摩托360)總是拋出的錯誤:Android Wear錯誤ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null}

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

在掌上電腦中的播放服務均達到最新

我已經添加了

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

把這兩個手持設備當作磨損build.gradle。

的佩戴活動:

@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(); 
    } 

我已經做了研究,但我找不到任何有效的解決方案。

+0

如果您正在爲磨損設備使用仿真器,請確保您的仿真器具有最新的Android版本。我有一個API 22的模擬器,我得到了錯誤。然後我創建了一個新的API 24(7.0牛軋糖),它的工作。 –

回答

6

我有類似的問題,當我使用谷歌上播放系統的Asus ZenWatch服務,

在可穿戴總是拋出錯誤:

ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null

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

我發現穿戴在身上,手持谷歌遊戲服務,可以不同步,我不知道爲什麼。

enter image description here

所以,檢查可穿戴的谷歌Play服務版本

設置 - >關於 - >軟件版本

並重新同步應用

啓動Android Wear應用程序 - >點擊齒輪圖標 - >選擇您的設備 - >重新同步應用程序

等待3-5分鐘,檢查可穿戴Google Play服務版本。

當同步完成時,也許你可以工作。

希望你明白我的英文破碎。

+0

解決了這個問題,謝謝。 – Julius

+2

嗯谷歌播放服務沒有爲我同步。在我的手機上,它是版本8.1.15,在磨損仿真器上它是7.3.27。 – user2968401

+0

與上面相同的問題 – KOTIOS

2

如果所選答案對某些人工智能不起作用,請嘗試此操作。要獲取最新的谷歌播放服務,需要dl模擬器的最新系統映像(API 22截至此文章)。我以前使用API 21

1

我通過在gradle腳本中降級庫版本解決了相同的情況。

手機項目依賴最初是

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

手錶項目依賴是

compile 'com.google.android.support:wearable:2.0.0-alpha1' 
compile 'com.google.android.gms:play-services-wearable:9.2.0' 

的電話,要求停止升級的東西我已經降低從9.2.0版本9.0.0後在這兩種情況下。

1

我有這個相同的問題。

我可以通過將Android Play服務更新爲Android Mobile和Android Wear設備上的相同版本來解決此問題。

您可以通過

Settings -> Apps -> Google Play services -- The version should be listed near the top. 

下一頁檢查您的移動設備上的Android Play服務版本,請訪問Android Wear設備,並檢查了Android Play服務版本。這可以通過去

Settings -> About -> Click on Versions -- The version should be listed 

如果這些版本是不一樣的,你需要升級低版本是相同版本的較高者來完成。

首先,請轉到http://www.apkmirror.com/apk/google-inc/google-play-services/下載Android Play服務APK:確保獲得與您的其他設備相同的版本 - 此鏈接包含下載以及爲您的設備找到正確APK的好信息。

您可以使用此命令將APK安裝到您的Android Mobile設備。如果您的設備上安裝了當前版本的Google Play服務,則需要-r(重新安裝)。

adb install -r <path to APK> 

您還可以使用藍牙將APK直接安裝到您的Android Wear設備,如果這是需要更新的設備。這需要更多的工作。

首先,確保您的Wear和移動設備已配對。導航到移動設備上的「Android Wear」應用程序,在左上角,您應該看到設備的狀態已連接。點擊齒輪並向下滾動到部分標題「通過藍牙進行調試」。確保這些設置是這樣的:

**Debugging over Bluetooth** 
Host: disconnected 
Target: connected 

接下來,運行這兩個命令

adb forward tcp:4444 localabstract:/adb-hub 
adb connect localhost:4444 

最後,運行此命令

adb devices 

你應該可以看到連接的兩個設備。

**List of devices attached** 
localhost:4444 device 
"Device Name" device 

如果你有什麼看起來像這樣

**List of devices attached** 
localhost:4444 unauthorized 
"Device Name" device 

您需要在Android Wear設備上啓用調試模式。這可以通過將

Settings->About and pressing the Build Number tab 7 times. 

回去

Settings->Developer Options, this should have just appeared. 

確保通過藍牙

打開兩個ADB調試和調試

最後,現在你有兩個您的設備來完成附加,您可以使用此命令將APK安裝到您的Android Wear設備上

adb -e install -r <path to APK> 

Q請注意,這將需要10分鐘左右,而且沒有任何事情會發生。請耐心等待。最終您會得到如下回復:

76 KB/s (18622942 bytes in 238.161s) 
pkg: /data/local/tmp/com.google.android.gms_9.2.56_(534- 124593566)-9256534_minAPI20(armeabi-v7a)(240dpi)_apkmirror.com.apk 
Success 

一旦兩款設備具有相同的Google Play服務版本,則應該很好。快樂的編碼!

0

在我的情況對

compile 'com.google.android.gms:play-services:9.8.0" 

升級編譯爲10.0.1時,固定它,我得到的錯誤。

0

我在嘗試測試時發生了這個問題Android Wear模擬器運行7.1.1 W播放服務10.2.89。我的build.gradle依賴項設置磨損模塊中的11.0.1。 最簡單的一個最快的解決辦法是嘗試設置播放服務的版本在你的build.gradle等於或小於你有你穿的是什麼設備或模擬器在我來說,我設置:

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

和它的工作。

相關問題