31

I've made a chat app that uses Firebase's feature Real-time database. I face a problem with google authentication. The problem started when I downloaded the app from the Play Store, the authentication was working perfectly when I was running the app in debug mode. When users try to sign in they get a toast message code:10 message:10.

I would like to note here that: I've added the SHA1 fingerprint. How can I solve this?

*Not sure if this is helpful but I've followed step by step this tutorial

5 Answers 5

40

You need three keys in order to make it work:

  1. The debug key. Informations here.

  2. The release key. Informations here.

  3. Google Play App signing key. Informations here.

All these keys are needed in order to make the sign-in process work.

Other informations here.

Sign up to request clarification or add additional context in comments.

15 Comments

I found this answer in another post in stackOverflow but as I am a beginner I don't know how to get all these keys! Can you edit your answer and elaborate it a little bit :) ?
I've added a debug and release SHA1 fingerprint but I don't understand how to add the third key ( google play app signing key) .
That is the official documentation but please take also a look here.
Thank you a lot, actually it wasn't that hard to find that google play app key. Now the google authentication works perfectly fine :)
A fourth key will be needed if you intend on using internal app sharing: stackoverflow.com/a/62763633/1702810
|
18

After generating SHA1 for release key, I forgot downloading the new google-service.json file that caused the same error.

Make sure you follow the instruction https://developers.google.com/android/guides/client-auth to generate and add debug/release SHA1 to firebase console and download google-service.json after updated.

If you use Use app signing by Google Play option, you need an additional step:

After uploading app into google play console, go to Release management > App signing, copy SHA1 and paste to firebase console enter image description here

Update

In the new google play console, the App signing key can be found as following: Setup > App signing enter image description here

Comments

3

Make sure you have added signed SHA1. If you are using debug one then it will not gonna work for live apk.

You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME.android

then in Android studio follow the below steps 1. Run your project 2. Click on Gradle menu 3. Expand Gradle Tasks tree 4. Double click on android -> signingReport

You can see SHA in Run Tab

for more information see link

7 Comments

Okay, how can I obtain a signed SHA1?
You need to put "debug.keystore" in this path C:\Users\USER_FOLDER_NAME\.android then in Android studio follow the below steps 1. Run your project 2. Click on Gradle menu 3. Expand Gradle Tasks tree 4. Double click on android -> signingReport You can see SHA in Run Tab
@KwnstantinosNikoloutsos please check the answer, I have updated it.
I have added this SHA1 fingerprint in firebase console and I am waiting to see if it is working :) Thank you for the help, I will keep you updated
I fixed it. Apart from adding the SHA1 key that you have told me about, we also need to add the Google Play App signing key as Alex Mamo said.
|
2

I had this problem and the solution was:

1.In tab Gradle -> Double click signingReport -> get the SHA-1.

2.Copy this generated SHA-1 from Android Studio, then paste to Firebase -> Project Setting -> General Setting -> SHA FingerPrint.

3.In Project settings firebase Download file google-service.json

4.Add file google-service.json in project and rebuild.

Comments

0

For me the problem was that i registered app and enabled google signin on Firebase console but I was testing with the debug version of app which has slightly different package name (same name but ended with .debug) so it was not working because the debug app is not yet registered. so additionally to my release app i also added the debug app to the firebase project for the app and it generated it's own google-services.json which i download and set to src/debug/google-services.json.

I believe this might be useful to some one else.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.