StatusCode = DEVELOPER_ERROR on google login

Below is the code I use to sign in to Google. I added the google-services.json file to the application folder. I am using classpath 'com.google.gms:google-services:2.0.0 ' in the gradle root directory. I checked my package on the developer console and its correct one and I added the SHA1 key, which I received by running the command keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android on the terminal (I using ubuntu). I have enabled the Google+ API. I created an OAuth consent screen and an OAuth client ID. Until I try to log in with google-

{statusCode = DEVELOPER_ERROR, resolution = null}

I am checking a similar question, but have not found a suitable solution. Code

 GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestProfile().requestId() .requestEmail().requestScopes(new Scope(Scopes.PLUS_ME)) .requestScopes(new Scope(Scopes.PLUS_LOGIN)) .build(); mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this, this /* OnConnectionFailedListener */) .addApi(Auth.GOOGLE_SIGN_IN_API, gso) .build(); googleButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN); } }); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == RC_SIGN_IN) { GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); handleSignInResult(result); } } private void handleSignInResult(GoogleSignInResult result) { if (result.isSuccess()) { // Signed in successfully, show authenticated UI. GoogleSignInAccount acct = result.getSignInAccount(); } else { // Signed out, show unauthenticated UI. // updateUI(false); } } @Override protected void onStart() { super.onStart(); mGoogleApiClient.connect(); } @Override protected void onStop() { super.onStop(); if(mGoogleApiClient.isConnected()) { mGoogleApiClient.disconnect(); } } @Override protected void onResume() { super.onResume(); if(mGoogleApiClient.isConnected()) { mGoogleApiClient.connect(); } } 

manifest

 <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <!-- To use account credentials --> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 
+5
source share
6 answers

Your problem probably is that you selected SHA1 from ~/.android/debug.keystore , but don't use it to sign your assembly.

  • Go to the "Module Settings" tab and add a profile with a single Store File field set to /Users/<your_user>/.android/debug.keystore

  • On the Flavors tab, select it from the Signing Config drop-down list.

  • On the Design Types tab, select it in the Signing Config drop-down list for your build type (probably it will be Debug ).

  • Cleaning and restoration.

+6
source

If you are working on two computers, you need to generate SHA1 again and add to console.firebase.google.com, download google-service.json and add it to your project

+5
source

I have the same problem and this solution worked. Hope this helps you and others.

Apply the plugin: 'com.android.application'

 android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { 

Make sure this application is the same as the name of your package in the manifest file (upper and lower case)

  applicationId "com.example" minSdkVersion 17 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } 
+5
source

Use .requestIdToken (BACKEND_CLIENT_ID) with GoogleSignInOptions.

How to get BACKEND_CLIENT_ID can be found here: https://developers.google.com/identity/sign-in/android/start-integrating#get_your_backend_servers_oauth_20_client_id

Hope this helps!

+3
source

deciding to add the SHA-1 debug storage in the firebase console for my application located here C: \ Users \ my name.android when you create the keystore for release , change it in the firebase console

+3
source

Thanks to Alexei Guryev for the hint ... I solved my problem by making sure that the debug keys are actually used during the build.

For me in Android Studio, the problem was that Signing Config was not installed at all. I'm still wondering how this happened.

As soon as I installed Signing Config in my configuration called "debug", then it all started to work.

enter image description here

0
source

All Articles