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:29

You might have generated and added wrong SHA1 key. Use following steps to generate SHA1 key in Android studio:

  1. Click on Gradle (From Right Side Panel, you will see Gradle Bar)
  2. Click on Refresh (Click on Refresh from Gradle Bar, you will see List Gradle scripts of your Project)
  3. Click on Your Project (Your Project Name form List (root))
  4. Click on Tasks
  5. Click on Android
  6. Double Click on signingReport (You will get SHA1 and MD5 in Run Bar(Sometimes it will be in Gradle Console))

Now add this SHA1 key in your firebase android project.

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

enter image description here

The way I fixed it was by picking up the key corresponding to the highlighted text. Due to the confusing usage of the word 'server' in Firebase's documentation page I was picking up the Server key . Which was the reason for the problem.

You can find the key here.

查看更多
姐就是有狂的资本
4楼-- · 2019-01-04 11:32

I came across this error in my firebase app. It was fixed when I added therequestIdToken(activity.getString(R.string.default_web_client_id)) part below.

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestEmail().requestIdToken(activity.getString(R.string.default_web_client_id))
        .build();

    apiClient = new GoogleApiClient.Builder(activity)
        .addConnectionCallbacks(this)
        .enableAutoManage(activity, this)
        .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
        .build();

    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(apiClient);
    activity.startActivityForResult(signInIntent, RC_GOOGLE_SIGN_IN);
查看更多
Bombasti
5楼-- · 2019-01-04 11:34

I got this error when i updated my json config file with a new google account.

Uninstalling the application manually and reinstalling the app worked for me.

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

You need to add your SHA1 key to firebase console configuration. You can do it in this way:

Firebase console ( https://console.firebase.google.com ) -> your project -> configuration -> scroll to

enter image description here

You can find your SHA1 key running "Signin report" from Android Studio:

enter image description here

Then, look the "run tab" and click the button:

enter image description here

I think it's the easier way. Hope this help.

查看更多
我想做一个坏孩纸
7楼-- · 2019-01-04 11:38

I had the same issue and I got it working by doing these steps:

1.Add DEBUG_KEYSTORE SHA1 fingerprint to the firebase project. use the following command(MAC/LINUX)

  keytool -exportcert -list -v \-alias androiddebugkey -keystore ~/.android/debug.keystore  

2.Now Generate a signed apk of your project. The process includes generating a keystore for your app's release version.

  Copy the path of the newly generated .jks file.

3.Now generate RELEASE_KEYSTORE SHA1 fingerprint using the following command

  keytool -list -v -keystore FULL_PATH_TOJKS_FILE -alias ALIAS_NAME

4.Copy the new SHA1 from the output and add it as another SHA1 fingerprint in your firebase application console.

Now you are good to go! ---- Hope! it helps.

查看更多
登录 后发表回答