3

I'm developing a flutter app which includes google sign in with firebase. Google sign in is working perfectly on emulator but when I export signed bundle and test on physical device. It doesn't work. Is there anything I need to add in gradle file? Can someone please guide me?

5 Answers 5

4

This happens because the SHA1 and SHA256 for release and debug are different.

So since we have added only the debug keys, we also need to add the release keys.

For that we need to open Google Play Console > (Click on your App) > Setup in Left Pane > App Integrity

There you will get App signing key certificate and Upload key certificate

Copy the SHA1 and SHA256 from both keys and paste in Firebase Project under Project Settings.

enter image description here

3

Goto Play store and Search for "App Integrity"

Google play store app integrity

Then
Copy the SHA Keys and Add into the Firebase signing keys.

and then you are good to go.

2
  1. Add SHA1 and SHA256 keys in your firebase project, also add proper email id in the project setting while setting up the SHA keys.
  2. Download the google-services file again
  3. Rebuild the project
  4. If you're planning to release the app on play store then you need to setup OAuth.
2
1

You need to add the release sha-1 to Firebase. Run signing report in Android Studio to get the sha-1 and add it to your Firebase project under Project Overview settings.

1

I figured out a solution for it. Actually the Google sign in was not working after I upload it to google play and then install it as a tester. Problem was that the Google play generates different SHA1 and SHA256 keys. But, I had only added the keys from Android Studio and this was causing a problem. I got the problem solved when I found SHA1 and SHA256 keys from Google play app and added them to firebase. Thank you very much to the respected people who tried to help.

2
  • did you add keys you got from google play with the keys you generated from android studio OR remove the old ones and only put keys from the play store ... please help me.
    – Anmol Shah
    Nov 17, 2021 at 18:35
  • We don't need to remove anything, just add the new keys Dec 25, 2021 at 15:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.