Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Developer Error even after putting everything in place in release mode (Android) #905

Closed
Ragnar-23 opened this issue Jul 13, 2020 · 29 comments

Comments

@Ragnar-23
Copy link

Info

React native google signIn is working fine in debug mode.
But google siginIn is not working in release mode, its giving DEVELOPER_ERROR code 10.
I have added both debug and release certificates on firebase console, everything is checked.

But still I am getting DEVELOPER_ERROR. Do we need to add SHA1 from playstore also for release mode (apk generated using ./gradlew assembleRelease)?

Expected Behavior

Actual Behavior

Environment

Please provide

System:
    OS: Windows 10 10.0.18362
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 1.13 GB / 7.84 GB
  Binaries:
    Node: 12.9.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 28, 30
      Build Tools: 28.0.3, 29.0.3, 30.0.0
      System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Version  3.6.0.0 AI-192.7142.36.36.6392135
  Languages:
    Java: 1.8.0_211
    Python: 3.8.3
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.0 => 0.63.0
  npmGlobalPackages:
    *react-native*: Not Found
@radetsky
Copy link

Maybe you turned on Google Play Signature in Play Market. This feature replaces your certificate by auto-generated by Google.
You can find it at the Play Console on the page 'App signature'. You can download deployment certificate or just copy-paste fingerprints MD5, SHA1, etc.
Copy SHA1 to Firebase Console App settings Android app.

PS. Also, it works for Facebook sign in. Download the certificate and do something like this:

cat ~/Downloads/deployment_cert.der | openssl sha1 -binary | openssl base64

to get hash to use with Facebook application settings

PS. I'm not a contributor. I'm also dev. :)

@rogerdribeiro
Copy link

I'm having the same problem

@Kailash23
Copy link

Same problem

@hoanganhnh2009
Copy link

I'm having same problem.

@abhilash-behera
Copy link

I have used a webClientId which I put to the whitelisted client ids in firebase console inside google login. But still it gives me DEVELOPER_ERROR. If I use my debug keystore, the login works because I have added the SHA1 of debug keystore in firebase console. But I cannot add the SHA1 of release keystore because it is already used in another project which I have lost access to. So I have created a new web client and added its id to the firebase google login whitelist and using the same inside the app. But still getting DEVELOPER_ERROR

@usmansbk
Copy link

usmansbk commented Jul 31, 2020

I use this package every year and every year I have to come back here. Lol

@usmansbk
Copy link

If you're still having this problem try this solution #706 (comment)

@abhilash-behera
Copy link

@usmansbk your solution did not help. I have already added the correct SHA1 to firebase. I am not using the default debug keystore. I have created my own and added the SHA1 to firebase. When I build the app using this keystore it works fine. But when I do the same with another keystore it does not work even after whitelisting the web client id

@stanica
Copy link

stanica commented Sep 1, 2020

Just started getting this problem too. Everything seems to be configured correctly, including SHA1.

@rnnyrk
Copy link

rnnyrk commented Sep 3, 2020

Can't seem to solve this issue. I have two custom keystores setup.
What I did:

  1. Exported the SHA-1 with keytool -exportcert -alias KEYSTORE_ALIAS -keystore KEYSTORE_PATH and inserted this to my dev and prod app in Firebase
  2. Also on https://console.developers.google.com/ I have two OAuth 2.0-client-ID's with the correct package names and SHA-1 fingerprints
  3. Copied the webClientId from Firebase Console > Authentication > GoogleSignIn and added it before the signin with Google.Configure
  4. My Android build buildTypes are as following:
    buildTypes {
        debug {
            debuggable true
            productFlavors.dev.signingConfig signingConfigs.dev
            productFlavors.prod.signingConfig signingConfigs.prod
        }
        release {
            debuggable false
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFiles fileTree(dir: "${project.rootDir}/proguard_libs", include: ["*.pro"]).asList().toArray()
            productFlavors.dev.signingConfig signingConfigs.dev
            productFlavors.prod.signingConfig signingConfigs.prod
        }
    }
  1. Downloaded my latest google-services.json
  2. Ran ./gradlew clean and adb uninstall com.packagename
  3. npm run android

Still the same DEVELOPER_ERROR.
I'm really out of options.. Anyone suggestions?

@usmansbk
Copy link

usmansbk commented Sep 3, 2020

Always check the version to debug-keystore SHA you generated. I think there's one in the android/ folder of the project and there's ~/android of the whole system.

@kushavi2509
Copy link

No matters weather you are using a firebase or NOT you have to have both the configurations (Android as well as Web client )
Screenshot 2020-09-09 at 5 35 45 PM

//DeveloperError or any login error
https://developers.google.com/identity/sign-in/android/start-integrating#next_steps

Click on Configure a prioject
Select the project.
Fille the required fields.
Voylla, you are good to go.

@SanjanaTailor
Copy link

SanjanaTailor commented Oct 21, 2020

I am facing same developer_error since I am using android React native app to complete google singin.
Also, I am not using Firebase to login
I created both OauthCilent android and Web client 2 and giving same id here to signin

GoogleSignin.configure ({
      webClientId: '***.apps.googleusercontent.com',
})

also to create SHA-1 for android used this command to C:\Users\satailor\Documents\ReactNative_workspace\App>keytool -list -v -alias androiddebugkey -keystore C:\Users\satailor\Documents\ReactNative_workspace\app\android\app\debug.keystore
and copied SHA-1 and added in google cloud console for same.

Inside Android folder following changes are added:
settings.gradle file
include ':react-native-google-signin', ':app'

android/build.gradle file included following lines:

buildscript {
 ext {
     googlePlayServicesAuthVersion = "17.0.0"
}
dependencies { 
classpath 'com.google.gms:google-services:4.3.2'} 

Help me to resolve an issue. Let me know any other information required.

@reinvanimschoot
Copy link

Is there currently any solution to this problem? As many of you, I am struggling with the same problem. Everything is in place but I still get DEVELOPER_ERROR.

@shivanshr
Copy link

Please help with this issue, I have tried everything available on the git and stack-overlow for this issue.
All of the information cross checked twice, fingerprints, etc, created and deleted project twice.

@shivanshrajpoot
Copy link

shivanshrajpoot commented Dec 17, 2020

If you are using firebase & still looking for solutions:

  1. Please match your key fingerprint in firebase console.

  2. Do not initialize the configuration with keys, I repeat, do not provide any configuration object in the .configure() function
    Do this GoogleSignIn.configure().

  3. Point 2 will resolve the issue. :)

https://stackoverflow.com/a/65339002/9940151

@shivanshrajpoot
Copy link

Please help with this issue, I have tried everything available on the git and stack-overlow for this issue.
All of the information cross checked twice, fingerprints, etc, created and deleted project twice.

https://stackoverflow.com/a/65339002/9940151

@shivanshrajpoot
Copy link

Is there currently any solution to this problem? As many of you, I am struggling with the same problem. Everything is in place but I still get DEVELOPER_ERROR.

https://stackoverflow.com/a/65339002/9940151

@gideaoms
Copy link

Following this tutorial fixed the problem for me.

@ftzi
Copy link

ftzi commented Feb 19, 2021

If you are using firebase & still looking for solutions:

1. Please match your key fingerprint in firebase console.

2. Do not initialize the configuration with keys, I repeat, do not provide any configuration object in the .configure() function
   Do this `GoogleSignIn.configure()`.

3. Point 2 will resolve the issue. :)

https://stackoverflow.com/a/65339002/9940151

Not having an argument will throw to me
Must specify an idToken or an accessToken.

@art1373
Copy link

art1373 commented Mar 5, 2021

Following this tutorial fixed the problem for me.

https://github.com/t-ho/react-native-google-signin-example
this helped

@vonovak
Copy link
Collaborator

vonovak commented Aug 24, 2021

closing because this is not an issue with the library but with the app setup / environment. Thanks

@vonovak vonovak closed this as completed Aug 24, 2021
@Ruwa353
Copy link

Ruwa353 commented Aug 24, 2021

Nice work

@deserthurricane
Copy link

I use Firebase signin approach. It requires using webClientId param in configure method. That is enough for iOS and some Android (for example, Huawei) devices.
But, according to my experience, most Android devices fail without offlineAccess: true param. Adding it resolved this issue for me.

@JordaoViktor
Copy link

Must specify an idToken or an accessToken.

how did you solved?

@ghost
Copy link

ghost commented Sep 25, 2024

@shivanshrajpoot ,then where else to provide this configuration like

{ webClientId: Constants.GOOGLE_CLIENT_ID_WEB, scopes: scopesToUse, offlineAccess: true, hostedDomain: '', forceConsentPrompt: true, accountName: '', forceCodeForRefreshToken: true, }

Please

@shivansh-rajpoot-vas
Copy link

shivansh-rajpoot-vas commented Sep 25, 2024

@shivanshrajpoot ,then where else to provide this configuration like

{ webClientId: Constants.GOOGLE_CLIENT_ID_WEB, scopes: scopesToUse, offlineAccess: true, hostedDomain: '', forceConsentPrompt: true, accountName: '', forceCodeForRefreshToken: true, }

Please

Hi @AleeFarook , It's been quite a lot of time since I wrote this comment, but the configuration is automatically picked up from the config file that you download from console. If you reinitialise with a config object then it does not uses the config from the file.

@shivansh-rajpoot-vas
Copy link

Hi Everyone, this issue is because of how configure is called for different platforms, this has been there for a lot of time and wasted a lot of time of others as well, If I had know that this will frighten the people for so long I would have created the PR my self, but here's one PR that someone create to fix this. check this may be fork it for temporary solution. #1003

@ghost
Copy link

ghost commented Sep 26, 2024

Hi @shivansh-rajpoot-vas, your solution was worked without the configuration object but I my case I was require the serverAuthCode which I was getting null, so after some trouble the solution I found that:

` await GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true });

  const config = {
    offlineAccess: true,
    forceCodeForRefreshToken: true,
    webClientId: Constants.GOOGLE_CLIENT_ID_WEB,
  };

  GoogleSignin.configure(config);

  const userInfo = await GoogleSignin.signIn();
  // console.log('GoogleSignin userInfo=====', userInfo);
  const token = await GoogleSignin.getTokens();
  // console.log('GoogleSignin token=====', token);

`
And I was missing the sign in api key which i get from services config file and set in android manifest:

<meta-data android:name="com.google.android.gms.auth.api.signin.API_KEY" android:value="API_key"/>

and add sign method of google sign in Authentication module in Firebase from side menu.

now the solution worked

and Thanks @shivansh-rajpoot-vas for quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests