【问题标题】:Google Fit integration issue in AndroidAndroid 中的 Google Fit 集成问题
【发布时间】:2015-12-11 06:49:14
【问题描述】:

在 Android 中集成 Google Fit 时出现此错误:

连接失败。原因:
ConnectionResult{statusCode=SIGN_IN_REQUIRED,
分辨率=PendingIntent{3162627d: android.os.BinderProxy@2a943572}}

LogCat:

12-11 12:21:00.207
21307-21307/com.google.android.gms.fit.samples.basichistoryapi
I/BasicHistoryApi:准备好 12-11 12:21:00.266
21307-21307/com.google.android.gms.fit.samples.basichistoryapi
I/BasicHistoryApi:正在连接...

12-11 12:21:01.369
21307-21307/com.google.android.gms.fit.samples.basichistoryapi
I/BasicHistoryApi:连接失败。原因:
ConnectionResult{statusCode=SIGN_IN_REQUIRED,
分辨率=PendingIntent{3162627d: android.os.BinderProxy@2a943572}}

12-11 12:21:01.376
21307-21307/com.google.android.gms.fit.samples.basichistoryapi
I/BasicHistoryApi: 尝试解决失败的连接

【问题讨论】:

  • 错误提示需要登录。你登录了吗?你的代码在哪里?还有logcat
  • @cricket_007 我使用了本教程developers.google.com/fit/android/get-started。 Log cat 只显示我上面提到的这一行。
  • 好的,那么你坚持教程的哪一步?
  • @cricket_007 我已经完成了所有的事情,但是当我执行应用程序时,连接失败并且每次都显示上面的 logcat。
  • 设备上是否有登录的有效 Google 帐户?也许不相关,但你是在模拟器中运行它吗?

标签: android google-fit google-fit-sdk


【解决方案1】:

我也遇到了同样的问题。 转到开发者控制台,创建新项目, -> API Maqnager -> 凭证 -> 新凭证 -> OAuth cielnt ID 选择 Android 并设置您的指纹和包名称。

【讨论】:

    【解决方案2】:

    您需要使用您的包名称和 IDE 的 SHA1 Hash 密钥从 google ai 控制台生成 Outh2 Client

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-14
      • 1970-01-01
      • 2017-03-28
      • 2016-04-17
      • 1970-01-01
      • 2020-12-29
      • 2022-08-03
      • 1970-01-01
      相关资源
      最近更新 更多