Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google signIn not working in release mode apk android

In release mode, my google sign-in is not working, but it works fine in debug mode. I got a similar question from SO here, but I didn't get perfect solutions.

My handleSignInResult is coming false - How can this be fixed?

like image 516
Elizabeth Avatar asked May 03 '16 08:05

Elizabeth


3 Answers

Yesterday same problem occurred to me.

Google has released a new signing service in playstore publish console in which google will signin your app with his keystore. After signing , it will give you a new SHA which you have to add in your firebase account.

Enter SHA provided by Google in your firebase account

like image 165
HarshitG Avatar answered Nov 08 '22 05:11

HarshitG


When you upload app on play store

After signing , it will give you a new SHA which you have to add in your firebase account.

enter image description here enter image description here Its Working HAPPY Coding Cheers

Add new SHA1 in https://console.firebase.google.com

Create Release SHA1 using Command Line

keytool -list -v -keystore "E:\Jsk_file\healthNickel" -alias healthNickel

keytool -list -v -keystore "E:\Jsk_file\YOUR_JKS_FILE_NAME" -alias YOUR_JKS_ALIAS_NAME

Enter keystore Password :- YOUR_KEYSTORE_PASSWORD

enter image description here

like image 39
Keshav Gera Avatar answered Nov 08 '22 06:11

Keshav Gera


I had same problem, i did read some posts and was able to get work done by following below steps

Step 1) Please go to https://console.developers.google.com/apis/credentials?

Step 2) Click on create credentials ->select OAuth client ID ->select application type as Android

Step 3) then generate Signing-certificate fingerprint by writing below command in command prompt before that you should have keystore and its path

     keytool -exportcert -keystore "D:\PlayStore_keystore\myproject.jks" -list -v

Step 4) after click on enter you will be asked for

     Enter keystore password : 
     Enter password which you have used for creating keystore 

Step 5) then it will give details regarding keystore like SHA1,SHA256,MD5 etc.

Step 6) Enter SHA1 as fingerprint and give packagename which is in manifest file

step 7) Click create you will get new OAuth client ID

step 8) now you have got client id you will need to get google-services.json file.

step 9) please goto https://console.firebase.google.com

step 10) if you already have project with that packagename ->go to overview ->click on menu icon where packagne name is written

step 11) select settings goto-> project Settings-> add Android app (in the bottom) -> there will be option called Add fingerprint

step 12) in step 5 you have got SHA1 paste that in certificate fingerprint and save it

step 13) now download new google-services.json file (as it conatins new client id ,certificate_hash etc)

step 14) paste that google-services.json file in app folder in your android project.

step 15) You are good to go...

like image 55
Janardhan R Avatar answered Nov 08 '22 05:11

Janardhan R