OAuth consent screen blank in android app with Google Fit

佐手、 提交于 2021-02-18 03:39:08

问题


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.

Image of the popup

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

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

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.

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)

Thanks for any help.


回答1:


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.

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)

Guys have a similar problem with GoogleSignIn




回答2:


Follow the instructions at http://developers.google.com/fit/android/get-started for registering an Android client.

Ensure that the Fit API is enabled for your Cloud project.

Check your credentials for your Cloud project:

  • Ensure that your package name for your credentials matches the sample.
  • Ensure the package name matches the applicationId in the app/build.gradle file.
  • Ensure the Signing-certificate fingerprint is entered correctly.

Additionally from OAuthConsentScreen add test users and set User Type to external



来源:https://stackoverflow.com/questions/65735897/oauth-consent-screen-blank-in-android-app-with-google-fit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!