Google sign in working on emulator but not on Android device flutter

Viewed 1124

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

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

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.

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.

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.

Related