googlesamples / google-signin-unity

Google Sign-In API plugin for Unity game engine. Works with Android and iOS.
Other
416 stars 227 forks source link

Sample project not working anymore #35

Open banerjee-toy opened 6 years ago

banerjee-toy commented 6 years ago

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.

lightbringer commented 6 years ago

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)

alwaysakil commented 6 years ago

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

lightbringer commented 6 years ago

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

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

alwaysakil commented 6 years ago

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

timtimma commented 6 years ago

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.

Syrlander commented 6 years ago

@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...

alwaysakil commented 6 years ago

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..

natalvenetz commented 6 years ago

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?

mjmac87 commented 6 years ago

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.