googlesamples/google-signin-unity

Sample project not working anymore

banerjee-toy opened this issue · 9 comments

Since last few days, the unity google sign in sample is not working anymore. It did work earlier however now it throws DeveloperError with 'Google.GoogleSignIn+SignInException'. Please help.

You are most likely passing a wrong webclientId into the sample script. Make sure the id was created as "web application" in the Oauth2 client id section in the developer console of your project.
(I spent a day to figure out that an "android" key does not work if you set GoogleSignIn.Configuration.RequestIdToken to true; even if an Android App is what you're building)

SAme exception here.
trying with firebase.
'Google.GoogleSignIn+SignInException'. Please help.

Ok, your Google project has to have to Oauth clients configured:

  • One web client (A)
  • One Android client (B) (make sure that you sign the apk and enter the key's finger print in the Google project)
  • Enter the web client's id (A) into the unity project

I tried the Unity sample myself last week. It works. It's purely a configuration error on your Google project.

I guessed so. Let me try again from scratch. and come back with results!

Same exception here.'Google.GoogleSignIn+SignInException'.
I have tried two Oauth client ids(web application one and android one) with sample project. Both not work
Please help.

@timtimma I'm currently having the same issue, in my project I have found that the error occurs with the following code, on line 47-48 in the sample:
GoogleSignIn.DefaultInstance.SignIn().ContinueWith( OnAuthenticationFinished);

I don't know if anyone has a solution yet, I have at least tried several ideas from other people, but nothing seems to work...

I got it working. It had to do with me creating credentials on my own and mixing it up with Firebase's own credential creating ...
Yes it gets a while to configure it correctly..

Tried a lot of different configurations, but none of them worked out for me. Here are the exact steps i took:

  1. Created new GCP Projekt added
  2. Created new Oauth client ID Credentials under APIs & Services
    Application Type: Web application
    Did not set any Restirctions at all and clicked on Create
  3. Generated an new keystore in Unity and got the Signing-certificate fingerprint from it
  4. Created another Oauth client ID Credentials under APIs & Services
    Application Type: Android
    Added the SHA-1 Signing-certificate fingerprint and the correct package name and then clicked on Create
  5. Added the Client ID from the Web client Oauth credentials to the SigninSampleScript
  6. Connected my Android phone to the computer, clicked on build and run
  7. Clicked on Sign In in the android app
  8. Got Error: Google.GoogleSignIn+SignInException

Is it ag Bug? Did something change in the Way you have to create the Credentials?

I struggled with this for a while until I came across the following:

keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%.android\debug.keystore

Don't get the SHA-1 from your unity project. You need the debug version instead which is tied to your computer+android.