Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got Error: DeveloperError Exception of type 'Google.GoogleSignIn+SignInException' was thrown. #49

Open
ChiefBreakeverything opened this issue Jun 28, 2018 · 8 comments

Comments

@ChiefBreakeverything
Copy link

ChiefBreakeverything commented Jun 28, 2018

I've run into this error while using the example scene as directed in the ReadMe. Unlike outcomes other users have reported before, I'm 99% certain the issue isn't related to the spelling of the webClientID string (process thus far detailed below) so I was wondering what else it could possibly be.

Here's a list of the things I've triple-checked:

  • Created an API key and web application OAuth 2.0 client ID on Google Cloud Platform and enabled the required APIs.
  • webClientID string in the SignInSampleScript scene; I copied/pasted the client_ID where the client_type is '3' directly from the google-services.json file, which was downloaded from the 'API & Settings' -> 'Credentials' page on Google Cloud Platform. I've also set up a Debug.Log to ensure its carried through correctly to the OnSignIn function (one user reported Unity was defaulting this string to its initial value)
  • The package_name from the same file where client_type is '1'. This is copied and pasted into Unity's player settings and also on the OAuth 2.0 entry in Credentials page of 'API & Settings' page of Google Cloud Platform.
  • The keystore file, key alias and their passwords are present in Unity's player settings. We aren't using debug.keystore and have created our own keystore file.
  • The SHA-1 fingerprint has been copied using the [keytool -exportcert -list -v -alias -keystore ] console command successfully and I've pasted it into the OAuth 2.0 entry in 'API & Settings' -> 'Credentials' page on Google Cloud Platform.
  • I've run AndroidResolver from the Unity -> Assets -> Play Services Resolver menu after each change, just to ensure up-to-dated-ness.

I managed to log each of the GoogleSignInStatusCode enum flag states returned with the GoogleSignIn.SignInException task and the results look like this:

  • Error.Status.Flag[Success] Is it this? [True]
  • Error.Status.Flag[ApiNotConnected] Is it this? [False]
  • Error.Status.Flag[Canceled] Is it this? [True]
  • Error.Status.Flag[Interrupted] Is it this? [False]
  • Error.Status.Flag[InvalidAccount] Is it this? [True]
  • Error.Status.Flag[Timeout] Is it this? [False]
  • Error.Status.Flag[DeveloperError] Is it this? [True]
  • Error.Status.Flag[InternalError] Is it this? [False]
  • Error.Status.Flag[NetworkError] Is it this? [False]
  • Error.Status.Flag[Error] Is it this? [False]

According to the parameter summarys and remarks in GoogleSignInConfiguration.cs:

  • Success = "The operation was successful"
  • Canceled = "The result was canceled either due to client disconnect or cancel()"
  • InvalidAccount = "The client attempted to connect to the service with an invalid account name specified."
  • DeveloperError = "The application is misconfigured. This error is not recoverable. The developer should look at the logs after this to determine more actionable information."

I'm not too sure what to make of these results (succeeded and cancelled are both true and it threw an error?). It appears I can specify an AccountName parameter for GoogleSignInConfiguration (null uses the 'default'), what format could that take?

Also, the remarks for DeveloperError mention more information being in the logs. I found the line:

  • TokenRequestor: You have wrong OAuth2 related configurations, please check. Detailed error: INVALID_AUDIENCE

Apparently this is a pretty common error and relates to some misconfiguration of the client ID settings. According to Mengcheng Duan back in 2014:

"Invalid audience means either your Android app is not registered in Google cloud console or it is registered in a different project other than the one where the server client_id lives.
The 403 is caused by the browser API key referer restrictions. Currently the workaround is to create a new browser/android API key without referer/package restrictions."

I've tried creating new client IDs several times with different settings and to no avail. Any help would be greatly appreciated in the mean time if the answer is clear! :)

Edit: After a lot of trial and error, the problem has been solved and it seemed to be something no one has pointed to yet. The action that switched it from not working to working was signing up as a Play developer (registration fee included) to gain access to the Google Play Console, and then seemingly creating an OAuth client under 'API Access' (its a big button, can't miss it). It makes sense I suppose, but it's strange that it hasn't been mentioned anywhere else in the documentation. Hopefully this report can act as a guide if anyone else ends up in a similar position.

@Syrlander
Copy link

Creating the OAuth client under the Google Play Console has solved the problem for my group as well, therefor I would assume that's the problem most other developers have when seeing the SigninException and not a problem with the package. Huge thanks @ChiefBreakeverything.

@kevinfoley
Copy link

kevinfoley commented Jun 20, 2019

@ChiefBreakeverything Perhaps you should close the issue if you found a solution? Although this solution doesn't make sense. The API Access section of Google Play is for setting up software that can edit and publish apps on Google Play using your Google Play Developer Account.

@karam89
Copy link

karam89 commented Jul 17, 2019

After days of losing efforts making it work, I just had to update the OAuth Consent screen (From Google Developers Console),

After updating the info on that screen, the exception has gone, and the sign in worked well

I've not read this information anywhere else

@bipinGosain
Copy link

Well finally solved it after 2 days of struggle!

Solution: Do make sure in the "OAuth consent screen" in google api console you've added name of your application properly.

@ninjarlz
Copy link

ninjarlz commented Aug 4, 2019

@karam89 yup, exactly, one has to make any change in that section, so as to make it possible to save new settings of 'OAuth Consent screen'. Rly strange, but works!

@Mukikaizoku
Copy link

@ChiefBreakeverything Thanks for this post---I inferred from your post that debug.keystore doesn't work for some reason and that you have to use your app's release keystore---doing that was what got the DeveloperError fixed for me.

During the process, I did add the Google Play Console Oauth client, but I removed it add things are still working--as @kevinfoley mentioned, it's unclear why that would be needed as it's function seems unrelated.

@iliaJelly
Copy link

SOLVED !!!
I had this problem for 2 days
I solved it by switching over to WIFI, mobile data blocks google account management on my Android.

This also makes me think if Google SignIn is a good tool since its not very foolproof on Wifi-less environments like public transportation and outdoors.

@BlissGDev
Copy link

It's happening the same to me and I'm not using Firebase.

I have the setup as follows:
-Android, iOS and Web keys configured.
-Added the correct SHA-1 string into the Android Key
-Added to the Unity Project the Web Id and pasted the configuration from Play Console
-Build with release keys
-Added accounts to testers on the Cloud Console Platform

But I keep getting the same error:
DeveloperError Exception of type 'Google.GoogleSignIn+SignInException'`

Any suggestion on what I might be missing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants