Error: Status{statusCode=DEVELOPER_ERROR, resoluti

2019-01-04 11:11发布

I am usign gplus sign in, and getting this error at time I am in onActivityResult....

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    callbackManager.onActivityResult(requestCode, resultCode, data);
    client.onActivityResult(requestCode, resultCode, data);

    if (requestCode == 0) {
        GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        if (result.isSuccess()) {

            GoogleSignInAccount acct = result.getSignInAccount();
//                Log.d("Result","details"+ acct.getDisplayName() + acct.getEmail());

            mEmail = acct.getEmail();
            String mFullName = acct.getDisplayName();
            String mGoogleplusId = acct.getId();


            SocialUser user = new SocialUser();
            user.setType("googleplus");

            user.setEmail(mEmail);
            user.setFullname(mFullName);
            user.setId(mGoogleplusId + "");
            loginParams.put("email_id", mEmail);
            loginParams.put("googlePlusId", mGoogleplusId);
            loginParams.put("full_name", mFullName);
            loginParams.put("registrationType", "googleplus");
            SignUpService(user);


        } else {
            Toast.makeText(CustomerLogIn.this, "Unable to fetch data, Proceed manually", Toast.LENGTH_SHORT).show();
        }
    }
}

And I am calling for gplus login on button click. On clcking button following code is executed....

 GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .build();
    mGoogleApiClient = new GoogleApiClient.Builder(CustomerLogIn.this)

            .addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
            .build();


    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
    startActivityForResult(signInIntent, 0);

And I am geetng this error...

Status{statusCode=DEVELOPER_ERROR, resolution=null}

on this line....

GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);

Please suggest the solution.

15条回答
劫难
2楼-- · 2019-01-04 11:38

For me it was working when I first implemented it, but stopped after a few days of development, with the mentioned error message.

I've solved the issue with these steps:

  1. I have added the sha-256 fingerprint on top of the sha-1 fingerprint that I already had in the firebase console. (Not sure if this step is required)
  2. I have downloaded google-services.json file again and replaced the old file.
  3. re-installed the app

and it worked

查看更多
老娘就宠你
3楼-- · 2019-01-04 11:39

Please Put correct json file in root of the android project
For more Refer here: http://coderzpassion.com/android-working-latest-google-plus-login-api/

查看更多
混吃等死
4楼-- · 2019-01-04 11:41

Ensure you enable Google Sign-In in under Authentication in the Firebase console.

查看更多
【Aperson】
5楼-- · 2019-01-04 11:47

Probably you created the configuration file using the SHA1 of your production token, use the androiddebugkey alias to gather the SHA1 corresponding to the debug version of your app and copy the configuration file to the 'app' directory, you should have both configuration files (one for debug purposes and another for production environment).

Based on the walkthrough published in https://developers.google.com/identity/sign-in/android/start

查看更多
萌系小妹纸
6楼-- · 2019-01-04 11:49

I was having the same problem, how I solved it is that I had different applicationId in my gradle file than the package name in my manifest file. And I used to applicationId to create the json file. I had to change my package name to what my applicationId was and that fixed it for me.

查看更多
在下西门庆
7楼-- · 2019-01-04 11:49

It's an old question, but I have been stuck with error 10 (DEVELOPER_ERROR) lately, because I was using the Android client ID, I created in the google developer console.

The solution for me was to use the Android credentials in google developer console only to indicate the SHA key of my apk and to use the client ID of the Web application (!) credentials from the google developer console in my cordova application.

config.xml:

<plugin name="cordova-plugin-googleplus" spec="^5.3.0">
    <variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.[web-application-client-id]" />
    <variable name="WEB_APPLICATION_CLIENT_ID" value="[web-application-client-id].apps.googleusercontent.com" />
</plugin>

code:

window.plugins.googleplus.login(
    {
       'webClientId': '[web-application-client-id].apps.googleusercontent.com'
    }, 
    ...

I don't use firebase.

查看更多
登录 后发表回答