react-native-google-signin / google-signin

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

[ANDROID] Problem with Google Signin Integration. DEVELOPER_ERROR with code 10 #1227

Closed Volodymyr-Ivaniuk closed 6 months ago

Volodymyr-Ivaniuk commented 6 months ago

I use react native cli, I did everything as written in the documentation. I created app in FireBase, added sign in method Google, added googlePlayServicesAuthVersion = "19.2.0", classpath 'com.google.gms:google-services:4.4.0' to my android/build.gradle file and added "apply plugin: 'com.google.gms.google-services'" to the end of the android/app/build.gradle file. After that i added android app in my project settings, added package name and three SHA-1 keys:

Screenshot 2023-12-18 at 23 14 48

debug and release (from ./gradlew signingReport)

Screenshot 2023-12-18 at 22 56 51

Application signing key certificate (from Google Play Console)

Screenshot 2023-12-18 at 23 01 17

Also, i checked release key from signingReport with key in Google Play Console, they are same. I downloaded json and put this file in this folder ./android/app. After that, i created in Google Cloud new API keys and OAuth 2.0 Client IDs for each SHA-1 key.

Screenshot 2023-12-18 at 23 08 44

In my code imported GoogleSignin from @react-native-google-signin/google-signin, created function signInWithGoogle and i passed function to my button into onPress prop.

Screenshot 2023-12-18 at 23 39 58

in debug mode it works cool. https://github.com/react-native-google-signin/google-signin/assets/150335864/e0cf6201-36fc-45b0-a02c-0b828a5ed027

When i generate .aab file, add it Google Play or App Center, download app from Google Play or App Center on my android device and try to use google sign in, i get this error. https://github.com/react-native-google-signin/google-signin/assets/150335864/fa2a1503-a9a9-4eae-a51a-64d8d4a35c44

Environment

react-native - 0.66.5 @react-native-google-signin/google-signin - 10.1.1 Java version - openjdk 15.0.2 2021-01-19 node - v14.21.3

android/build.gradlew

Screenshot 2023-12-18 at 22 35 50

android/app/build.gradlew

Screenshot 2023-12-18 at 22 36 12

gradle version

Screenshot 2023-12-18 at 22 37 35
vonovak commented 6 months ago

Hello and thanks for asking, this is always a configuration mismatch. Please see https://react-native-google-signin.github.io/docs/troubleshooting#getting-developer_error-or-code-10-error-message-on-android-when-trying-to-login-or-signin-hangs-and-never-resolves-the-promise

Thank you 🙂

Engazan commented 5 months ago

is there any fix for no firebase version ? my app is live and and google sign in doesnt work ... ( worked fine durring testing ) ..., i had to disable this feature for android

i had to implement login with email / password just for android and disable google login ( thanks OTA updates are in react ... )