OAuth consent screen blank in android app with Google Fit - android

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.

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

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

Related

Question on Firebase Authentication SHA1 for Android [duplicate]

My local android app is synced up in google firebase console with my SHA key configured in google.services.json. How do the developer on other end
can setup the project to use the same firebase console and json file.
We are trying phone based authentication. While setup at my end works is fine, but the developer on the other end is getting this error - This operation is not allowed. You must enable this service in the console.
Please help me with the correct way to do this.
Solution:
So for other developers, generate the SHA-1 Key as described in the picture
Go to Firebase Console:
Settings
Your Apps
Add Fingerprint and paste the SHA.
A solution for the comment:
So the answer is well written in the error. You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console.
So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio. Or just create a new project with different package name both ways will work for now.
Hope this info helps. Do let me know if it changes anything for you.
Adding to Sharan's answer, that is the correct one, you can add those SHA1 keys in your Firebase console going to
Project configuration - ADD FINGERPRINT
Remember to select the correct project at the Android apps panel in order to add those keys

Google sign in issue: "failed message=12500"

I m trying to migrate google sign in from one account to another in my android app. I have add the package name and sha1 key into new account and then also added the"google-services.json" file. But every time i m running it, it shows me "failed message=12500".
I have tried everything, looked at all the solutions everywhere.
When i use the old account and old "google-services.json" file it works but as soon i tried to migrate to new account it doesn't work. The crazy thing about this is that i m using other services as well like firebase notification, phone authentication and remote config they all work perfectly fine in the new account, but not google sign.
This did the trick:
Add application logo, Application Homepage link and Application Privacy Policy link. To add both link you can just copy and paste from Authorized domains section from "oAuth consent screen", for example: your-app-abc123.firebaseapp.com
This is a must step for migrating or adding a new app, because i spent hours and hours and with no results and only this thing helped me out.

How multiple developers can work on the same android app connected to a single Firebase console?

My local android app is synced up in google firebase console with my SHA key configured in google.services.json. How do the developer on other end
can setup the project to use the same firebase console and json file.
We are trying phone based authentication. While setup at my end works is fine, but the developer on the other end is getting this error - This operation is not allowed. You must enable this service in the console.
Please help me with the correct way to do this.
Solution:
So for other developers, generate the SHA-1 Key as described in the picture
Go to Firebase Console:
Settings
Your Apps
Add Fingerprint and paste the SHA.
A solution for the comment:
So the answer is well written in the error. You can't have two projects of the same package name. Even if you delete it. It will take a least 4-5 days to get deleted fully from the developer's console.
So the only solution is to generate a new SHA-1 key by custom signing the app by generating a signed apk from the android studio. Or just create a new project with different package name both ways will work for now.
Hope this info helps. Do let me know if it changes anything for you.
Adding to Sharan's answer, that is the correct one, you can add those SHA1 keys in your Firebase console going to
Project configuration - ADD FINGERPRINT
Remember to select the correct project at the Android apps panel in order to add those keys

Firebase Google Sign-in nothing happen, but EmailPassword works, no error log cat

I'm using this project : https://github.com/firebase/quickstart-android/tree/master/auth
The exact same code, the only change I've made is applicationID in build.gradle so it match my app id in firebase..I'd also copy the SHA1 and download do google json file into app folder, NO ERROR in log cat, I've trying to sign up using Email and password and it works! I receive the email to verify my email.
However, when I try to use Google Sign-in (using another email/GMail), the choices appear, I choose my gmail account, and then NOTHING happen.. no ERROR log.. I confused :(
I'd also try to add new account and the result are the same..
please help :( Thank you
btw, I already enable Google Sign-In Method in firebase in the first step..
Have you installed the app to your phone from another computer than the one you added the SHA1 from? As this will stop OAUTH from working - like you're describing. If this is a separate computer, then add generate the signing report and add the SHA1 to your application using the Firebase console.

Exception when trying to use Google Calendar API in android

I am getting exception as below:
Well, I've used or say copied same code as this shown in google doc https://developers.google.com/google-apps/calendar/quickstart/android .And I know it is the same error which is already mentioned in troubleshooting part of this doc but as mentioned in its solution, I had checked my SHA1 fingerprint and also package name and all the stuffs but still getting same error. And also I tried to google and followed each and every link the google suggested but nothing works for me so my last option was STACKOVERFLOW and so I am here. Please help if any one can. Thanks in advance.
Also I forgot to mention, it says "Unregistered Android application" it means that the OAuth2 client ID I created is not found by the app but I don't know how can I make it find my OAuth2 client ID and solve my problem.
Please make sure that:-
You enabled calendar API in google console for that project you are using, as the link provide in your response.
Also match your package name in AndroidManifest is similar to the package you mentioned in google dev console with SHA.
Try to create an Oauth client id under corresponding project in google console. Follow the steps in this link.
To create an OAuth 2.0 client ID in the console:
Go to the Cloud Platform Console.
From the projects list, select a project or create a new one.
If the API Manager page isn't already open, open the console menu and select API Manager.
On the left, click Credentials.
Click New Credentials, then select OAuth client ID.
Note: If you're unsure whether OAuth 2.0 is appropriate for your project, select Help me choose and follow the instructions to pick
the right credentials.
Select the appropriate application type for your project and enter any additional information required. Application types are described
in more detail in the following sections.
If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen. (The
following
procedure
explains how to set up the Consent screen.) You won't be prompted to
configure the consent screen after you do it the first time.
Click Create client ID.
Based also from this related post, you have to give permission from your calendar configuration (Calendar configuration -> Share this calendar) to the email account specified into Google Api Console (email adress).
Hope this helps!

Categories

Resources