使用Google Fit的android应用中的OAuth同意屏幕为空白 [英] OAuth consent screen blank in android app with Google Fit

查看:114
本文介绍了使用Google Fit的android应用中的OAuth同意屏幕为空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to use the Google Fit API in my application, after the user is prompted to choose a Google account the OAuth consent screen should be displayed, however I only get a blank popup with a indefinite loading indicator, this popup will stay like that unless I cancel it.

弹出窗口的图像

仅当我取消登录流程时,才会显示错误消息.

No error messages are displayed, only if I cancel the sign-in flow I would get an error that I cancelled it.

我尝试过使用个人proyect,以及 Google的示例proyect ,用户也是遇到相同的问题.

I have tried on a personal proyect as well as with Google's sample proyect, where other users are also experiencing the same issue.

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

As I describe on that issue, I have tested both apps on an emulator, a Huawei Pro 20 Lite, and on another device, with four different accounts, but get the same result.

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

Also have the correct configuration in the Google Cloud Console, using the proper applicationId and SHA1 signing key, I've tried on two different cloud projects, one of them brand new.

启动登录流程的功能就是这一功能,可以在示例应用程序中找到完整的代码

The function that launches the sign-in flow is this one, the full code from the sample app can be found here

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

感谢您的帮助.

推荐答案

我找到了一个解决方案,虽然很奇怪,但无论如何对我都有效:

I found a solution, it strange but anyway it works for me:

  • Delete your Cloud project
  • Instead of the following instructions from http://developers.google.com/fit/android/get-started create a new project with firebase.
  • Add an android app in firebase project settings
  • Add both the SHA1 and SHA256 to it.
  • Download google-services.json to android/app in your project folder.
  • Make sure to have my "support email" set on general Project settings.

如果这没有帮助,还请检查 Flutter和google_sign_in插件:PlatformException(sign_in_failed,com.google.android.gms.common.api.ApiException:10 :,空)

If this not help, please also check Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

人们在GoogleSignIn上也遇到类似的问题

Guys have a similar problem with GoogleSignIn

这篇关于使用Google Fit的android应用中的OAuth同意屏幕为空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆