Google sign in error Status{statusCode=DEVELOPER_ERROR, resolution=null}

Prashant picture Prashant · Oct 17, 2016 · Viewed 31.6k times · Source

I am integrating gmail login in my android application by following this thread :

https://developers.google.com/identity/sign-in/android/sign-in?configured=true

But I am getting error as :

Status{statusCode=DEVELOPER_ERROR, resolution=null}

I looked through this status code documentation here :

https://developers.google.com/android/reference/com/google/android/gms/common/ConnectionResult.html#DEVELOPER_ERROR

Above link does not help to diagnose the problem,

I have created the debug keystore file, & generated SHA-1 using keytool, also in Google developer console, I added package name as it is in manifest file or gradle file.

But all seems to fail can anybody tell me what does this error code suggest what may go wrong ?

Answer

Prashant picture Prashant · Oct 24, 2016

Problem was SHA1 mismatch,

1] First Keystore File : I solved the error, problem was while building apk Android studio was taking default keystore file which was located inside C:\Users\<LOGGED_IN_USER_NAME>\.android\debug.keystore

2] Second Keystore File : Also I created one other keystore file which was located at different directory i.e. app/keystore/debug.keystore

While configuring the google developer console to integrate gmail login within app I gave sha-1 key generated through second keystore file above, the studio while building the apk file taking other keystore file hence sha-1 key mismatch was happening.

In order to take my keystore file located @ app/keystore/debug.keystore I configured gradle file at app level with following code :

signingConfigs {
        debug {
            storeFile file('keystore/debug.keystore')
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storePassword 'android'
        }
        /*
        release {
            storeFile file('release.keystore')
            storePassword "mystorepassword"
            keyAlias "mykeyalias"
            keyPassword "mykeypassword"
        }
        */

Now the generated apk sha-1 signature matches with the sha-1 key configured on google developer console for your app.

One note : Always use debug.keystore for debugging the gmail integration (At the time of development).

Refs :

For gmail integration : https://developers.google.com/identity/sign-in/android/start-integrating

To see which sha-1 is getting used for your application see this stackoverflow thread : SHA-1 fingerprint of keystore certificate