Skip to content

Instantly share code, notes, and snippets.

@ajaykumar97
Last active January 1, 2020 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaykumar97/e4c02c1292142d6fc22b19d3721d2228 to your computer and use it in GitHub Desktop.
Save ajaykumar97/e4c02c1292142d6fc22b19d3721d2228 to your computer and use it in GitHub Desktop.
Google Signin Configuration
1. To generate SHA-1 key for android on Linux:
https://stackoverflow.com/a/34933381
OR
For Debug mode:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For Release mode:
keytool -list -v -keystore {keystore_name} -alias {alias_name}
--------------------------------------------------------------------------------------
Example:
keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test
--------------------------------------------------------------------------------------
OR
--------------------------------------------------------------------------------------
- Copy the APK to your PC in Program Files\java\jdkX.X.X_XXX\bin folder. In general, for windows, its C:\Program Files\Java\jdk1.8.0_191\bin and for mac, its /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home/bin
- Open CMD/Terminal in this directory and type the following
keytool -list -printcert -jarfile YOUR_APK_NAME.apk
- SHA1 value will be generated like: 79:D0:E6:80:4E:28:1E:D1:88:28:CB:D7:E6:BE:2E:0C:FB:24:98:52
=======================================================================================
2. To resolve google signin error: “Google sign in error 12500” Or “Non-recoverable error occurred”:
Make sure to:
- add SHA1 key for release and debug on firebase console(see above point for SHA1 key generation)
- add Support Email on the firebase console
- Add Application Homepage link, Application Privacy Policy link, Application Terms of Service link on https://console.developers.google.com/apis/credentials
- If app is on PlayStore(live or in beta),
-Go to https://play.google.com/apps/publish
-select your app
-From Left menu, go to release management -> App Signing and from the “App signing certificate” section, copy the SHA-1 key and update the key on the firebase console.
OR
We can connect our app with the firebase using Android studio firebase assistant, which automatically adds our SHA1 key to the firebase:
https://stackoverflow.com/a/47287677
https://stackoverflow.com/questions/47632035/google-sign-in-error-12500
https://stackoverflow.com/a/57007750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment