The question:
I went through this, and as far as the process goes I did that.
But I when I installed the app from play store I am not able to sign in using the google sign in
button.
I have used Firebase for google sign in. When I am clicking the sign in button the option to choose the account is coming but then it is not signing in or doing anything.
So where possibly am I going wrong?
The Solutions:
Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.
Method 1
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.
[]
Method 2
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
Method 3
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:
- Goto https://play.google.com/apps/publish/
- Click your application >> Release Management >> App Signing.
You will see “App signing certificate” and “Upload certificate”
- Copy the SHA-1 From “App Signing Certificate.” (THE TOP ONE)
- Goto https://console.firebase.google.com/
- Click your application >> Settings [Gearbox Icon to the right of project overview] (top of the screen) >> Project Settings >> General [Tab] >> Add Fingerprint
- Paste the SHA-1 App Signing Certificate. Save.
All fixed!
Method 4
There are three types of SHA1 is required for an app lifecycle when you are using firebase
- -debug SHA1
- -release SHA1
- -signing SHA1 (it getting from play store)
You need to add signing SHA1 to firebase after publish your application here i am attaching two screen shots please have a look . The red marked certificates is must be required, so copy it from playstore and paste it on firbase
In firebase paste here
Method 5
Issue happens because
1) when you create / publish an app through google play console, there is an option for enable Google Play App Signing. if you enable it will show
Google Play App Signing is enabled for this app.
then your Upload certificate details will change and you need to rewrite SHA-1 etc. certificate details in respective places.
2) You provided debug key store / SHA-1 certificate details instead of RELEASE certificate details
3) error while generating certificates.
Solution
1) Go to google play console
Relese management -> App signing
then you can see two types of certificate
1- Upload certificate ( your app certificate provided when generating signed apk)
2- App signing certificate ( because you enabled Google Play App Signing, so they provided new certificate details for your published apk)
you need to change uploaded certificate details with new details
provided by google play where ever you used it before. such as
Integrating google sign in (change SHA-1 of OAuth client),
facebook login (change key Hash (generate key hash using SHA-1
use this link or copy the key hash provided by facebook login
error screen), firebase etc.
2) provide release SHA-1 / keyHash
create / use Keystore details of signed apk.
using command prompt:
google / firebase SHA-1 :
keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v
facebook release key hash:
keytool -exportcert -alias <user alias name> -keystore < keystore path> | <openssl-path> sha1 -binary | <openssl-path> base64
if asked for password enter your signed apk keystore password.
Method 6
In the latest Google play console 2021:
QUICK GUIDE:
Application Play console
> Setup
> App Integrity
OR
Search App Integrity
in application’s Search box
DETAILED GUIDE:
Step 1: Go to https://play.google.com/console/u/3/developers and open your application’s Dashboard
Step 2: On the left sidebar under Release
, select Setup
, then App Integrity
.
Optional: You could also simply search App Integrity
in the Search.
Method 7
To add on existing responses, once you have the newly created SHA1:
Goto https://console.firebase.google.com:
- Select project
- Project Overview
- Project Settings
- ADD FINGERPRINT – enter SHA1 to Certificate fingerprint
- Save
Method 8
If someone is not able to solve this issue then just open Setup > app integrity
in the console and then copy the SHA1 and paste in your firebase console.
Method 9
In case of anyone facing this issue after Aug 2020. New SHA1 can be found at Setup->App Signing on your play console.
Everything else is the same as @PrinkalKumar as answered.
Method 10
in new version of the google console:
Setup > app integrity
Method 11
If you enabled “Google Play App Signing” when publishing your app, you are now probably dealing with two fingerprints:
The one coming from your local keystore (keytool -exportcert -keystore path-to-production-keystore -list -v), known as the “upload cert”.
The new one generated by Google when you enabled Signing (the “signing certificate”).
The conflict with this situation, is that you may end up with two OAuth 2.0 client IDs:
-
The one that you created before publishing your app (and before enabling google signing), which is indeed the “right” one.
-
A NEW one created by Google when you enabled Google Signing.
You can verify this fact from: Google Play Console -> Games Services -> Select your App -> Games Details -> API Console project -> Credentials -> OAuth 2.0 client IDs
SOLUTION
In order for Google Sign-in (and all related Games Services features) to work, I had to correct the fingerprint for my pre-existing OAuth2 Client ID (the one that I created before publishing my app).
-
Look for the “right” OAuth 2.0 client ID: Google Play Console -> Games Services -> Select your App -> Linked Apps –> Select your App –> Take note of the “OAuth2 Client ID” at the bottom.
-
Look for the “Signing” certificate: Google Play Console -> Games Services -> Select your App -> Game Details -> API Console project -> Credentials -> OAuth 2.0 client IDs –> “Android client for XXXXXX (auto created by Google Service)” –> Take note of the value (xx:xx:xx:etc….) Comment: In order to reuse this value in my other OAuth 2.0 client ID, I had to replace it with some dummy number. Otherwise, you will get error: “Certificate already used in some other project”.
-
Go to your pre-existing OAuth2 Client ID: Google Play Console -> Games Services -> Select your App -> Games Details -> API Console project -> Credentials -> OAuth 2.0 client IDs –> Select “OAuth 2.0 client ID” from step 1. Update certificate value with the one from step 2.
This solved my issue. Multiplayer is working perfectly in my app (Match4App).
Method 12
just goto the google play console > liked account and link your firebase project. Now it works fine!
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0