react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.13k stars 876 forks source link

login issue after uploading the apk in the Google Play Store #1161

Closed sukantasamanta96 closed 1 year ago

sukantasamanta96 commented 1 year ago

Steps to Reproduce

Google Login is working fine in the debug mode and also it is working fine in the signed apk, but while i upload in the play store by generating the aab file and download the apk after publishing it. Then i am checking the google login not working.

Environment

jeremyhoffmann commented 1 year ago

Having exactly the same issue and was trying to find support.

-works on Android debug -Works on IOS debug and Production -Do not work once published to the play store (the screen to select the google account appears and when I select the account, the screen closed and nothing happens) No error message.

Environnment: -react-native-google-signin/google-signin version "8.0.0" -react-native" version "0.69.5"

kesha-antonov commented 1 year ago

Same thing. Our app crashes with ClassCastException: java.lang.String cannot be cast to com.facebook.react.bridge.ReadableNativeMap

"@react-native-google-signin/google-signin": "^9.0.2",
kesha-antonov commented 1 year ago

I'm trying this also https://docs.expo.dev/guides/google-authentication/ Will report here

Mayze123 commented 1 year ago

Same issue, i have added both debug sha1 and sha256 and google play developer (app integrity) sha1 and sha256 in firebase params fingerprints. I have added the support email but it does work anymore. i get this "A non-recoverable sign in failure occurred". I have followed all the steps but nothing works for me. "@react-native-google-signin/google-signin": "^9.0.2" "react-native": "0.71.4" it works on ios debug and prod, android debug but not prod

rahul-jalandhra commented 1 year ago

Same issue, i have added both sha1 at google play developer. It works on ios debug and prod, android debug but not prod. I also have followed all the steps but nothing works for me. "react-native": "0.71.4", "@react-native-google-signin/google-signin": "^9.0.2",

Mayze123 commented 1 year ago

Same issue, i have added both sha1 at google play developer. It works on ios debug and prod, android debug but not prod. I also have followed all the steps but nothing works for me. "react-native": "0.71.4", "@react-native-google-signin/google-signin": "^9.0.2",

is your android app auto signed?

Mayze123 commented 1 year ago

Same issue, i have added both sha1 at google play developer. It works on ios debug and prod, android debug but not prod. I also have followed all the steps but nothing works for me. "react-native": "0.71.4", "@react-native-google-signin/google-signin": "^9.0.2",

Mayze123 commented 1 year ago

The issue for me is that i had, two keys in app integrity. If it is you case you should add both (sha1) and both sha256 in firebase console

rahul-jalandhra commented 1 year ago

I am using server auth verification without firebase then. How can I manage it?

On Sat, Apr 29, 2023 at 2:27 AM Mahamadou Taibou @.***> wrote:

The issue for me is that i had, two keys in app integrity. If it is you case you should add both (sha1) and both sha256 in firebase console

— Reply to this email directly, view it on GitHub https://github.com/react-native-google-signin/google-signin/issues/1161#issuecomment-1528083777, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARGIJNDJXBTABIMFBJ6FJJDXDQVKHANCNFSM6AAAAAAXHDCZII . You are receiving this because you commented.Message ID: @.*** com>

kesha-antonov commented 1 year ago

Did you try this guys?

It worked for me finally !!!

Go to Google Play - App Integrity - Cope/paste sha1/256 to Firebase - download google-services.json - replace file in android/app - remove webClientId from GoogleSignin.configure - rebuild - and it works in dev & in google play !

https://github.com/react-native-google-signin/google-signin/blob/master/docs/android-guide.md#google-login-does-not-work-when-downloading-my-app-from-the-play-store

jeremyhoffmann commented 1 year ago

Thanks a lot @kesha-antonov, the answer to my issue was well in the guide you have provided.

Here's the part of the doc for me (I'm not using Firebase):

Google Login does NOT work when downloading my app from the play store. Check if "Google Play App Signing" is enabled for your app. If it is enabled, you will need to add the "App signing certificate" SHA-1 to your firebase console.

You can find it at: App -> Release (in left sidebar) -> Setup -> App integrity. Under the App signing key certificate, copy SHA-1 certificate fingerprint into firebase console for the Android app.

If you are not using firebase, and your app is enabled for "Google Play App Signing": Go to "https://console.developers.google.com/" -> click "Credential" in the right panel -> Find "Client ID" for type "Android" under "OAuth 2.0 Client IDs" section -> Edit -> replace "SHA-1 certificate fingerprint" with the one from App -> Release (in left sidebar) -> Setup -> App integrity -> App signing key certificate.

Thank you again!

sukantasamanta96 commented 1 year ago

Thanks @kesha-antonov for your reference. It is working fine in debug and also in google play.

vonovak commented 1 year ago

Hello and thanks for reporting, seems like the issue was resolved, so I'm going to close. Thank you 🙂

daveandcoding2023 commented 1 year ago

Did you try this guys?

It worked for me finally !!!

Go to Google Play - App Integrity - Cope/paste sha1/256 to Firebase - download google-services.json - replace file in android/app - remove webClientId from GoogleSignin.configure - rebuild - and it works in dev & in google play !

https://github.com/react-native-google-signin/google-signin/blob/master/docs/android-guide.md#google-login-does-not-work-when-downloading-my-app-from-the-play-store

@kesha-antonov it is still not working...i tried this whole step...i have tried it with firebase first then with google OAuth...but still facing the same error..

likrot commented 1 year ago

@daveandcoding2023 I had the same. But I've just done one thing. Try to switch to Legacy key (just to copy SHA1) and use this value. This is only what worked in my case. I can finally use google oauth in my production and internal-test version of the app.

Screenshot 2023-07-11 at 14 23 56
oledavid commented 8 months ago

@daveandcoding2023 I had the same. But I've just done one thing. Try to switch to Legacy key (just to copy SHA1) and use this value. This is only what worked in my case. I can finally use google oauth in my production and internal-test version of the app.

Screenshot 2023-07-11 at 14 23 56

I can confirm this also works in my case, after trying every other single option available, was almost giving up. Change app signing key to legacy, copy the key to OAuth 2.0 in google cloud credential section of your app save and it worked. Thanks alot @likrot

SnehWAD commented 6 months ago

what do mean by remove googlesignin.configure and google client id ,should i compeletly remove it aur replace it with new ones, but the new ones are eventually the same

Did you try this guys?

It worked for me finally !!!

Go to Google Play - App Integrity - Cope/paste sha1/256 to Firebase - download google-services.json - replace file in android/app - remove webClientId from GoogleSignin.configure - rebuild - and it works in dev & in google play !

https://github.com/react-native-google-signin/google-signin/blob/master/docs/android-guide.md#google-login-does-not-work-when-downloading-my-app-from-the-play-store

MunishPrimo commented 6 months ago

@likrot I had the same. But I've just done one thing. Try to switch to Legacy key (just to copy SHA1) and use this value. This is only what worked in my case. I can finally use google oauth in my production and internal-test version of the app.

Thank you, this works for me.

tushe-tv commented 6 months ago

@daveandcoding2023 I had the same. But I've just done one thing. Try to switch to Legacy key (just to copy SHA1) and use this value. This is only what worked in my case. I can finally use google oauth in my production and internal-test version of the app.

Screenshot 2023-07-11 at 14 23 56

Thanks man

shoaib-jamal commented 6 months ago

@daveandcoding2023 I had the same. But I've just done one thing. Try to switch to Legacy key (just to copy SHA1) and use this value. This is only what worked in my case. I can finally use google oauth in my production and internal-test version of the app.

Screenshot 2023-07-11 at 14 23 56

Seriously man it worked! Just need to copy Legacy SHA-1 from App Signing to my Firebase SHA certificate fingerprints, and in my case it worked without even requiring to reconfigure the google-services.json

rohanots commented 4 months ago

Not getting the option to switch to Legacy mode. Can anyone help. image

momguide commented 2 weeks ago

Having exactly the same issue and was trying to find support.

-works on Android debug -Works on IOS debug and Production -Do not work once published to the play store (the screen to select the google account appears and when I select the account, the screen closed and nothing happens) No error message.

Environnment: -react-native-google-signin/google-signin version "8.0.0" -react-native" version "0.69.5"

Same here, too. RN 0.74.1 "@react-native-google-signin/google-signin": "^11.0.1"

jeremyhoffmann commented 2 weeks ago

Hi Momguide,

This works for me:

If you are not using firebase, and your app is enabled for "Google Play App Signing": Go to "https://console.developers.google.com/" -> click "Credential" in the right panel -> Find "Client ID" for type "Android" under "OAuth 2.0 Client IDs" section -> Edit -> replace "SHA-1 certificate fingerprint" with the one from App -> Release (in left sidebar) -> Setup -> App integrity -> App signing key certificate.

When you have setup google authentication first, you may have used a local key you have generated on your machine. Once deplyed to production, you need to update this key and not longer used your local one.

albertaleksieiev commented 1 week ago
  1. Go to your google play console, navigate to app signing and copy sha-1 key image
  2. Go to firebase project settings image
  3. And in section Your apps press Add fingerprint and paster there your sha-1 key image

So you can use 1 key for dev and 1 key for prod which is created by Google