Google sign in not working after publishing in play store

When you upload an apk to the play store then play store creates a new SHA1 key called "App signing certificate". You get that SHA1 and save in your console or firebase account (as you need).

New SHA1 will be found at Released Management->App Sigining on your play console.

[enter image description here]


The problem was created when Google Play App Signing was enabled for my app. Google Play App Signing changes the SHA-1 certificate fingerprint (from what is in my keystore) to their own SHA-1 certificate fingerprint.

The fix:

  1. Goto https://play.google.com/apps/publish/
  2. Click your application >> Release Management >> App Signing.

You will see "App signing certificate" and "Upload certificate"

  1. Copy the SHA-1 From "App Signing Certificate." (THE TOP ONE)
  2. Goto https://console.firebase.google.com/
  3. Click your application >> Settings [Gearbox Icon to the right of project overview] (top of the screen) >> Project Settings >> General [Tab] >> Add Fingerprint
  4. Paste the SHA-1 App Signing Certificate. Save.

All fixed!


Update: Google changed behaviour of uploading APK, check answer below!

Release APK and debug APK has different SHA1 and different API keys for google services. Both of them must be added in Firebase Console -> Project settings. Then download google-services.json from here, add it to project and recompile with release keystore using option "Build signed APK". That should work