Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sign in not working from app downloaded from playstore

  1. Created an app which uses react-native-google-signin to login to the app with google login
  2. Created a keystore for to sign my app, as is described here
  3. Signed my app and uploaded into Google Playstore
    • When I was asked if I want to opt-in for the Google Play App Signing, I agreed
  4. If I try to login to my app (downloaded from the playstore), I'm getting an error messsage: DEVELOPER_ERROR, error code: 10

Note1: my app does not use firebase

Note2: if I install the apk directly into my device, the login seems to work

I'm sure the problem has something to do with how the application is signed with Google Play App Signing but I'm not able to isolate the issue

Update:

  • Downloaded the google-services.json from here and added it under /android/app and now the app works if I download it from the release management page and install it manually. Still doesn't work if I install it directly from the Google Play Store though.
like image 627
Raghudevan Shankar Avatar asked Nov 04 '17 04:11

Raghudevan Shankar


4 Answers

It is very simple, Go to play store account where you uploaded your signed APK. select your App, then go to the Release Management section then App signing.

Copy the SHA1 key of App Signing certificate.

Go to this link https://developers.google.com/identity/sign-in/android/start-integrating

Click on CONFIGURE A PROJECT button

select your App, select Android, App your app package name, then paste the SHA1 certificate

Then click Create. Thats it.

Now you can use google signin in your App

like image 130
raj peer Avatar answered Sep 30 '22 19:09

raj peer


Solution:

  • The problem was that while generating the google-services.json, the App signing certificate SHA-1 certificate fingerprint needs to be provided; I was providing the Upload certificate's SHA-1 certificate fingerprint which is why it wouldn't work on production.
  • In essence, in the credentials page, you'll need to create a two oauth client ids for Android (one with the App Signing certificate and one with the Upload certificate and one oauth client id of type web and in while using react-native-google-signin you need to specify the webClientId.
like image 28
Raghudevan Shankar Avatar answered Sep 30 '22 21:09

Raghudevan Shankar


You added sha-1 key for your app in debug mode and at that time you will be able to do google sign in your app. But as the app goes in production, it requires sha-1 key for production. And that you need to add at firebase console. You can check your firebase console and check for android app.

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android 

The above commad helps to create sha-1 key for debug version.

You meed to provide you signed key-store file path for production sha-1. And this will be done with command

keytool -exportcert -list -v \-alias <your-key-name> -keystore <path-to-production-keystore>

You just need to provide specific paths for keystore file for released apk.

like image 38
Prince Avatar answered Sep 30 '22 21:09

Prince


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 fireenter image description herebase account. See the image for the better understanding

like image 40
Sathish Swaminathan Avatar answered Sep 30 '22 20:09

Sathish Swaminathan