Google Plus Login failed when uploaded to Google Play

630 Views Asked by At

I recently tried uploading the ionic release apk on Google Play. The app opens but google plus login doesn't work.

I googled various blogs and post but couldn't find the perfect one. Majorly has answer to the firebase one. But, here I'm using non firebase project which can be created in google console.

So, as per the process, I used the web client id of console project in my app, which was created by SHA of my local debug keystore. Then, I signed with the local keystore certificate and uploaded in the play console.

Catch is now, play console signs the apk with it's fingerprint. So, how should I move further to enable google plus signin into my app?

My thinking: I should use play's "app signing SHA" to create new "android" client in "console project" and use it instead of previous "web client id". And update that client id into my project. Now sign the apk with "upload apk" and then upload it on play. Can anyone tell, will it work?

2

There are 2 best solutions below

0
Gaurav Gupta On BEST ANSWER

Finally, able to deploy the apk on the play store after series of long documentations, blogs and fail attempts. I hope it could provide help to others.

There is a slight different approach in deploying the apk with google plus sign-in on play store now. Earlier, one can sign the apk with the release key and later deploy it on playstore, but what if you want to upload it with "Google play app signing" enabled? Also, my app was in ionic and has non-firebase project on developer console.

Workaround:

  • Maintain a different project on Google console, so that you can have two web-client id's against two different SHA fingerprint (one of debug keystore and other one app-signing SHA of play console).

So, considering the situation if you want to get it deployed on play store, follow steps:

  • Once you have created application on play store and enabled google app sign on the same, copy the "SHA-1 fingerprint" of "App signing certificate" and paste it in the developer console, against which you will get the "web client id", which will be used in google plus signin.

Follow these links -

Integrate the new web client id everywhere in your app needed and then follow mentioned in ionic documentation - https://ionicframework.com/docs/v1/guide/publishing.html

Catch is -

Make sure to update your new generated release fingerprint, generated from command:

  • keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

with the command :

  • keytool.exe -importcert -file upload_cert.der -keystore

This will replace your certificate fingerprint from auto-generated to that of RSA fingerprint provided by Google Play Console. You can download the "upload certificate" in "upload_cert.der form" which will be used in above command.

Now, with this, approach, your both certificates get used just as you use debug.keystore and release.keystore convertionally. Finally, following above link's steps, you will end up having compressed apk which you can further upload on google console.

Now, scenario is, you have to maintain two projects on developer console, if you want it to get tested locally - either you have to maintain two different project ids or have android feature product flavour.

Thank You!

1
Sanjay Bhalani On

Generate Release SHA1 key & add into firebase console, hope you have release key store file. (debug key store does not work for uploading apps to play store)

Generate release key store using an android studio.

Here are the steps:

Step:1 Go to Gradle

Step 2: Select project root

Step 3: Then select tasks

Step 4: Then select Android

Step 5: Then click Signing report

Alternatively, you can use a command line to get your SHA-1 fingerprint:

keytool -list -v -keystore "C:\Users\user\releasekey.jks" -alias yourkeystorealias -storepass yourkeystorepass -keypass yourkeystorepass