Google の例の android-SynchronizedNotifications は、Google API クライアントに接続できなかったため機能しません。修正方法は?
https://github.com/googlesamples/android-SynchronizedNotifications/をダウンロードし、Android Studio のエミュレーターでアプリケーションを実行しました。この例では、GoogleApiClient.Builder で Wearable.API を使用しており、次のエラーで失敗しました:
08-27 12:38:40.355 2532-2532/com.example.android.wearable.synchronizednotifications
E/SynchronizedFragment: Failed to connect to Google API Client
デバッグから、理由がわかりました:
API_UNAVAILABLE: connectionResult = {ConnectionResult@4465} "ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}"
私のセットアップの詳細:
OS - MAC X エル キャピタン
Java-jdk1.8.0_102
プロジェクトは、Google API、Google Play サービス、Google リポジトリ、Android サポート リポジトリがインストールされた API 23 (marshmallow) でコンパイルされました
エミュレータ - Android Studio、API 23、Nexus 5 から
GoogleApiClient.Builder で Wearable.API を使用するためにあらゆる種類の資格情報を使用する必要があるという情報が見つからなかったため、Google Play Android Developer API または API キーの OAuth 2.0 などの Google API の資格情報は使用しませんでした。