私はGoogle Fitで作業しようとしています。何らかの理由でアプリでGoogle Playサービスに接続できません。私はOAuthを完全にセットアップしました。私は別のアプリでそれをテストしました。すべてうまく動きました。具体的にはGoogleFitRepositoryを見てください。ここがAPIに接続しています。接続しようとすると、私はこのエラーを取得していGoogle Playサービスに接続できません。キャンセルステータスコード
:GitHubのに
W/AutoManageHelper: Unresolved error while connecting client. Stopping auto-manage.
I/MyApp: Google Play services connection failed. Cause: ConnectionResult{statusCode=CANCELED, resolution=null, message=null}
リンク:https://github.com/drb56/FitnessExplorer
を任意の助けいただければ幸いです。私はこの一日中立ち往生してきました!
編集:ここでは、APIがフィットAPIと一緒に実行されるようにサインインの新しい更新は、グーグルが必要で質問
public GoogleFitRepository(Activity activity)
{
mClient = new GoogleApiClient.Builder(activity.getApplicationContext())
.addApi(Fitness.HISTORY_API)
.addApi(Fitness.SESSIONS_API)
.addScope(new Scope(Scopes.FITNESS_ACTIVITY_READ))
.addConnectionCallbacks(this)
.enableAutoManage((FragmentActivity)activity, 0, new GoogleApiClient.OnConnectionFailedListener() {
@Override
public void onConnectionFailed(ConnectionResult result) {
Log.i("MyApp", "Google Play services connection failed. Cause: " +
result.toString());
}})
.build();
activityList = new ArrayList<>();
activityDataPointList = new ArrayList<>();
calorieActivitiesToday = new ArrayList<>();
dayActivities = new ArrayList<>();
}
適切な質問をしてください。少なくともコードを貼り付けてください。 – suku
申し訳ありませんが、GoogleApiClientに接続するコードを追加しました – user292277