'Firebase Authentication fails after publishing App

I am using 2 google accounts and 2 different firebase projects for Development and Release for android app. I have Implemented Google Authentication on both of them. Both operate well when I have the build. i.e Dev also performs Authentication and release build as well. When I publish my app on Google Play Console and download it via play store, Google Authentication fails. It gives Error "Sign In Cancelled! RC: 0"



Solution 1:[1]

I got solution.....

Open Play console -> Release Management -> App Sign in -> SHA-1 Certificate.

Copy SHA-1 Key and Past in Firebase Console

Go To Firebase Project -> Project Setting -> SHA Certificate Fingerprint -> Add Fingerprint-> Paste SHA-1 Key

Solution 2:[2]

The SHA-1 certificate is now under App Integrity

Solution 3:[3]

The reason behind this is that release APK and debug APK has different SHA1 and different API keys for google services.

Both of them must be added in Firebase.

Steps:

Firebase Console -> Project settings.

Download google-services.json from here, add it to project and recompile with release keystore using option "Build signed APK". That should work, and now your authentication should not be failing.

To get the new New SHA1, just go to Released Management->App Sigining on your play console.

Solution 4:[4]

For Users of the NEW PLAY CONSOLE ( by the time I am writting this is in Beta).

Open Play console -> Choose your App (Click) -> (Release section) Click Setup -> App Sign in -> (App signing key certificate) SHA-1 Certificate.

Copy SHA-1 and SHA-256 Key and Paste in Firebase Console in your App Settings.

If you are using Facebook Login as well you may need to convert your SHA-1 to Key Hash.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Patel Vijay
Solution 2 Margalit
Solution 3 PradyumanDixit
Solution 4 Xenolion