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

DeveloperError Exception of type 'Google.GoogleSignIn+SignInException' was thrown. #51

Open
Ryu17 opened this issue Jul 10, 2018 · 16 comments

Comments

@Ryu17
Copy link

Ryu17 commented Jul 10, 2018

Hi there!

I was following the guide and found something different.

"This file contains the client-side information needed to use Google Sign-in. The details on how to do this are documented on the Developer website."

I entered SHA1 and the package and created a json file by clicking 'Configure a Project' through the developer website link, but the file looks different from the guide.

image

Is it wrong to choose Android from the image above?

My json file looks like this:
{"installed":{"client_id":"529939461761-1809034pngb3o70tgnlupamab0e1l8vs.apps.googleusercontent.com","project_id":"myproject-492d7","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}

@Ryu17
Copy link
Author

Ryu17 commented Jul 10, 2018

OK, I tried to solve this problem all day and finally solved it.

The above question was not wrong. The 'Google Sign-In configuration file' section in README.md is probably a file obtained through firebase. It looks different, but it is not wrong.

https://developers.google.com/identity/sign-in/android/start
Click the CONFIGURE A PROJECT button on this link, select the project, set it to Android, and enter the Package Name and SHA1.
(You need to get into the Player Settings in the Unity Editor, set the Keystore in the Publishing Settings and get the SHA1 value.)

Next, when you click the GOOGLE API CONSOLE button in the above link, there will be two kinds of OAUTH 2.0 CLIENT IDs in the project.
image
The CLIENT ID we need is 'Web client (Auto-created for Google Sign-in)'. Enter this CLIENT ID into the webClientId of SigninSampleScript.cs.

Finally, browse keystore in Publishing Settings and build with release. (You should never do Developer Build, I spent a lot of time here.)

I hope this will help you .

@toom1984
Copy link

thanks! helped to clear up stuff for me

@torresalmonte
Copy link

Thank you!, you saved the day! This was a very tricky situation.

@nphausg
Copy link

nphausg commented Jan 3, 2019

Agree with Toom, if you need an official guideline, please check here
https://github.com/googlesamples/google-signin-unity

screen shot 2019-01-03 at 10 48 40 pm

@bipinGosain
Copy link

bipinGosain commented Jul 20, 2019

Still getting this issue. I've cross-checked all of the above. Any other suggestion?

I'm using: a. Unity 2018.1.5f1 b. firebase_unity_sdk_6.2.0 c. google-signin-plugin-1.0.4

Steps:

  1. Setup a Unity App on Firebase.

  2. Imported both the plugin along with Sample Google Script.

  3. I'm using Google Sample's Sign In script.

  4. Added a SHA-1 fingerprint from C:\Users\user.android\debug.keystore, to Firebase console.

  5. Downloaded and added googleservices.json to root of the Assets folder.

  6. Used the id from google-services.json OAuth client type 3 to the WebClient ID.

  7. Always getting Google Sign In Exception
    NOTE: No third part modules added, just Unity Ads.

@Mukikaizoku
Copy link

@Ryu17 Thank you, that information was helpful! I wish that was in the ReadMe

@bipinGosain I'm not 100% certain, but it seems that using a debug.keystore doesn't work. I had to use the release keystore that I use for my app.

Also, it if you can check if that SignInException has Status=Error vs DeveloperError, that may help figure out what is wrong.

@bitCoder0
Copy link

bitCoder0 commented Feb 22, 2020

I had this problem recently, hope this note helps someone!
before telling my problem solution, something that you should check are steps mentioned in the @bipinGosain answer:

Still getting this issue. I've cross-checked all of the above. Any other suggestions?

I'm using: a. Unity 2018.1.5f1 b. firebase_unity_sdk_6.2.0 c. google-signin-plugin-1.0.4

Steps:

  1. Setup a Unity App on Firebase.
  2. Imported both the plugin along with Sample Google Script.
  3. I'm using Google Sample's Sign In script.
  4. Added a SHA-1 fingerprint from C:\Users\user.android\debug.keystore, to Firebase console.
  5. Downloaded and added googleservices.json to the root of the Assets folder.
  6. Used the id from google-services.json OAuth client type 3 to the WebClient ID.
  7. Always getting Google Sign In Exception
    NOTE: No third part modules added, just Unity Ads.

and remember to do a release build not debug(just in case)
the key in the json file works but for me id of key type 3 is the secound part of "oauth_client" part in google-services.json
for example:
you should copy bbbbYOURID.apps.googleusercontent.com part of json file not aaaaYOURID.app..:
my mistake was copying the client id of type 1 not 3

    "oauth_client": [
        {
          "client_id": "aaaaYOURID.apps.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.game.game",
            "certificate_hash": "2a6d7cc8a7423fa3c11b8577ff53812e6cf13f6e"
          }
        },
        {
          "client_id": "bbbbYOURID.apps.googleusercontent.com",
          "client_type": 3
        }
      ],

except json file,you can access that id by this way:
go to firebase console>authentication>secound tab(sign in method)>expand the google section>expand the "Web SDK configuration" part>copy the WebClient id
the key worked for me, without making a new key in firebase cloud page or without using the oauth key in the JSON file
image

image

@Alej-P
Copy link

Alej-P commented Dec 9, 2020

I was getting this error on Android (not iOS) and I just solved it after spending a couple of days on it.
Things to check:

  • the clientID you use in your Unity code is the WEB client ID but there needs to be an Android client created with the same account, referencing the correct app bundle id and SHA1 of the Release keystore. The Android Client ID is not used but the Android plugin seems to check that a valid Android client exists.
  • make sure you sign in with the Release keystore (I was using jenkins so I had to make a test Google Play release because all other local builds were throwing this error)

@bhanumadhavsharma
Copy link

I was getting this error on Android (not iOS) and I just solved it after spending a couple of days on it.
Things to check:

  • the clientID you use in your Unity code is the WEB client ID but there needs to be an Android client created with the same account, referencing the correct app bundle id and SHA1 of the Release keystore. The Android Client ID is not used but the Android plugin seems to check that a valid Android client exists.
  • make sure you sign in with the Release keystore (I was using jenkins so I had to make a test Google Play release because all other local builds were throwing this error)

How did you get the Release keystore?

Is this a separate command from the debug keystore? The command I used for the debug.keystore was "keytool -list -v -keystore C:\Users\username.android\debug.keystore -alias androiddebugkey -storepass android -keypass android".

Or am I misunderstanding and you have to release the app on the play store in order to acquire that keystore?

@nforcen
Copy link

nforcen commented Oct 9, 2021

It is strange for me, if I export apk, everything works Okay. On the other hand, if I create the .aab version and upload it to GooglePlay, I have this error. What could I do wrong?

@BlissGDev
Copy link

Hi, It's happening the same to me.

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

I got It working on iOS (adding the GoogleServices-Info.plist and adding the client id to URL schemes) but It doesn't seem to work in Android. I keep having the same error:
DeveloperError Exception of type 'Google.GoogleSignIn+SignInException'

Any suggestion on what I might be missing ?

@bontanksakti84
Copy link

you save my life and time bro...thank you

@LangInteger
Copy link

For anyone gets here after 2021, if you are signing your app with Play App Signing, you should also add SHA-1/SHA-256 generated by GP:

image

to your firebase console:

image

@PokerNinja
Copy link

For anyone gets here after 2021, if you are signing your app with Play App Signing, you should also add SHA-1/SHA-256 generated by GP:

image

to your firebase console:

image

Took me days. Now it's working!
Thank you Thank you Thank you!!!!

@okaydeep
Copy link

okaydeep commented Apr 12, 2023

For anyone gets here after 2021, if you are signing your app with Play App Signing, you should also add SHA-1/SHA-256 generated by GP:

image

to your firebase console:

image

It's work for me,

My situation is:
Local build apk -> works
Downloaded from google play beta test -> not working, throw exception

Just follow above steps, no need re building, then succeeded!

Thank you!!

@Surakshaajith
Copy link

I am not making use of firebase and i still encounter the same error in my untiy build.
unity - Got Error: DeveloperError Exception of type 'Google.googlesignin+SignInexception' was thrown

Local build apk works fine
when downloaded from google play open testing of aab file -> not working, throws above exception
Even though i do not use firebase for my project, i checked the aab file in firebase test lab, it runs without any error. What might be the reason?

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