简体   繁体   中英

Google Sign In via firebase ->

I followed this tutorial for adding Goggle Login to my App: https://firebase.google.com/docs/auth/android/google-signin?authuser=0

So the Code is similar to this: https://github.com/firebase/quickstart-android/blob/master/auth/app/src/main/java/com/google/firebase/quickstart/auth/GoogleSignInActivity.java

But when signing in i get this...

Error:

Google sign in failed
com.google.android.gms.common.api.ApiException: 10: at 
com.google.android.gms.common.internal.zzb.zzz(Unknown Source)at
com.google.android.gms.auth.api.signin.GoogleSignIn.
         getSignedInAccountFromIntent(Unknown Source)

I think I've setup the firebase and Google Console right. Also the Android Studio Assistent for adding firebase, says that the dependencies are correct.

What do I overlook?

I went through this problem and after much sweat I discovered that the problem was the wrong SHA1 key.

you have to generate a sha1 debug key while it is in the development phase. After launching your app you should use your release key.

for generate debug key, open keytool.exe and: keytool -exportcert -list -v -ali as androiddebugkey -keystore %USERPROFILE%.android\\debug.keystore passwd: android

done this, copy the generated sha1 key, in the firebase go to configuration of projects, add fingerprint. done this, download the json file for your project and run.

you must repeat this procedure with the sha1 release key.

I figured it out. Was kind of dump. I started an Project in the Google Console and later in Firebase. Then I tried to connect them to use the Webclient-Id... After all they where not combined so Firebase didn't find this Web-ID.

-> I just created a new Firebase Projekt and out of there created a new Google-Console Projekt where the Web-ID is generated. After implementing the new Web-ID in my App it worked fine!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM