android - 使用 Google Fit 的 Android 应用程序中的 OAuth 同意屏幕空白

标签 android oauth google-fit

我正在尝试在我的应用程序中使用 Google Fit API,在提示用户选择 Google 帐户后,应显示 OAuth 同意屏幕,但是我只收到一个带有无限期加载指示器的空白弹出窗口,此弹出窗口除非我取消它,否则将保持这种状态。

Image of the popup

不会显示任何错误消息,只有当我取消登录流程时,我才会收到取消登录的错误消息。

我已经尝试过个人项目以及 Google's sample proyect ,其他用户也是 experiencing the same issue .

正如我在该问题上所描述的,我已经在模拟器(华为 Pro 20 Lite)和另一台设备上使用四个不同的帐户测试了这两个应用程序,但得到了相同的结果。

还在 Google Cloud Console 中进行正确的配置,使用正确的 applicationId 和 SHA1 签名 key ,我尝试过两个不同的云项目,其中一个是全新的。

启动登录流程的函数就是这个,示例应用程序的完整代码可以在here中找到。

GoogleSignIn.requestPermissions(
    this,
    requestCode.ordinal,
    getGoogleAccount(), fitnessOptions)

感谢您的帮助。

最佳答案

我找到了一个解决方案,很奇怪,但无论如何它对我有用:

  • 删除您的云项目
  • 而不是 http://developers.google.com/fit/android/get-started 中的以下说明使用 firebase 创建一个新项目。
  • 在 Firebase 项目设置中添加 Android 应用
  • 向其中添加 SHA1 和 SHA256。
  • 将 google-services.json 下载到项目文件夹中的 android/app。
  • 确保在常规项目设置中设置了我的“支持电子邮件”。

如果这没有帮助,另请检查Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

大家在使用 GoogleSignIn 时也遇到了类似的问题

关于android - 使用 Google Fit 的 Android 应用程序中的 OAuth 同意屏幕空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65735897/

相关文章:

java - Android - 应用程序快捷方式的 Intent

android - 从 DataReadResult 读取数据时出现 IllegalArgumentException

node.js - 谷歌健身 : API gets only details of datasources but not the details of calories in nodejs

Android Google Fit 实时计步

java - 使用仪器框架进行单元测试时出错

android - Directions API 请求被拒绝 Android 客户端

oauth - 使用 Openiddict 的 ASP.NET Core 1.0 OAuth 服务器

java - Yahoo Oauth 不一致 "Invalid Signature"

asp.net - OWIN AuthorizeEndpoint 的 redirect_uri 与 web api 的 uri 不同

java - 不要将文本显示与设置的文本连接起来,而是使用 android 资源?