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 876 forks source link

Error: DEVELOPER_ERROR React Native 0.72 #1192

Closed kelvinvasquezitofc closed 11 months ago

kelvinvasquezitofc commented 11 months ago

When configuring google signing it shows the following error DEVELOPER_ERROR

GoogleSignin.configure({ offlineAccess: false, webClientId:'My_ID_ANDROID', iosClientId: 'My_ID_IOS', });

KubaKubikula commented 11 months ago

Same here tried everything but no success

lorenzolaricchia commented 11 months ago

I also have the same error. I'm currently on React Native 0.72.3 I'm using Firebase (@react-native-firebase/... version 16.4.6), but I don't think the error is related to it, since those who don't use it have the same error. On version 9.0.2 it was working perfectly.

neilanthonyte commented 11 months ago

In my case I register the production keystore in firebase . . and when running the app using emulator, it is the debug keystore that is being built . . what I did was replace the debug keystore with the production and it works

debug {
            // storeFile file('debug.keystore')
            // storePassword 'android'
            // keyAlias 'androiddebugkey'
            // keyPassword 'android'
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
adamblvck commented 11 months ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

vonovak commented 11 months ago

Hello and thanks for asking, seems the issue is resolved. Also, note that it's documented extensively in the android docs. Thank you 🙂

CruzNadin commented 9 months ago

In my case I register the production keystore in firebase . . and when running the app using emulator, it is the debug keystore that is being built . . what I did was replace the debug keystore with the production and it works

debug {
            // storeFile file('debug.keystore')
            // storePassword 'android'
            // keyAlias 'androiddebugkey'
            // keyPassword 'android'
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }

Worked for me, thank you.

schrodingersca8 commented 9 months ago

Hi, I am new to react-native. I am trying to implement google signin in expo using the Google Console API, but I am getting the DEVELOPER_ERROR.

Steps I followed:

  1. Created a new expo project with tabs template (SDK 49).
  2. installed @react-native-google-signin/google-signin library and generated a custom dev client in my android phone.
  3. created a eas.json file and ran command 'eas credentials -p android' and created a new key store, and copied the SHA-1
  4. generated webClientId and androidClientID.
  5. copied the code in the github repo
  6. getting DEVELOPER_ERROR on await GoogleSignin.signIn()

Thank you so much for your help.

lucasbasquerotto commented 8 months ago

I was having this issue and had done everything like @schrodingersca8. I solved it using the webClientId from the google project we use for authentication, which is different than the project in the google-services.json file.

I had added the SHA-1 in the project of the google-services file, but I had to create a new android oauth credential (at https://console.cloud.google.com/apis/credentials?project=) with the correct package name and SHA-1 in the same project that has the web oauth.

Devdannnny commented 5 months ago
offlineAccess: true,
      forceCodeForRefreshToken: true,

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

For those using Expo SDK 49 and with no firebase....This works for me

davidmonnom commented 4 months ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

Wooww, thanks man! I don't know how you came up with this but it works :)

audn commented 3 months ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

Thank you! I had to get the SHA1 from eas credentials instead of keytool -keystore path-to-debug-or-production-keystore -list -v to get it working on my non-firebase project.

aleksey-mukho commented 3 months ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

Man, you are the best! Thank you so much!

orichh commented 3 months ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

THANK YOUUUUUUUU. I've been stuck on this for freaking DAYS, and this finally got me to sign in correctly

Avizura commented 2 months ago

In my case it was incorrect package name provided to android client (there were 3 different ones in AndroidManifest)

iway1 commented 1 month ago

How is implementing Google Sign In on iOS way easier than on Android? man the guys at Google, they really don't know how to create a good developer experience.

Error message here is not informative "DEVELOPER_ERROR" gives no information of what went wrong.

iway1 commented 1 month ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

should be in the docs ideally

shreyakupadhyay commented 3 weeks ago

Code is Medicine. Insane what hoops were meant to be jumped through...

I made it run on SDK 49 EXPO, React Native 0.72.3, Android (since iOS works as butter):

  1. For Android, you'll need both a Web and Android credentials in Google API Console:
Screenshot 2023-08-08 at 23 58 54
  1. Find out your SHA-1 signing key for your development/production apk. If you've built using EAS, get your sha-1 by running eas credentials, then selecting android > com.yourbuild.app.dev. Put that SHA-1 Key, and the appropriate package-name in your Android OAuth credential in Google API console.

3. Now the biggest medicine moment, and super counterintuitive: use the WEB clientID in your config, instead of the Android clientID. I have no idea why this is...

googleSigninComponent.configure({
      scopes: ['https://www.googleapis.com/auth/drive'],
      webClientId: 'YOUR WEB CLIENTID, NOT YOUR ANDROID CLIENTID FROM GOOGLE CONSOLE',
      iosClientId: 'iosClientId for iOS, nothing special here',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
      profileImageSize: 120
});

After this, logged-ins work on Android.

This is really good works for me as well.