1

During google sign in I am getting the status code 12501

@Override
    public void onActivityResult(final SignInView loginView, int requestCode, int resultCode, Intent data) {
        if (requestCode == Constants.RC_SIGN_IN) {
            result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
            Log.d(TAG, "Status code " + result.getStatus().getStatusCode());
            final GoogleSignInAccount acct = result.getSignInAccount();
            if (resultCode == GoogleSignInStatusCodes.SUCCESS || resultCode == GoogleSignInStatusCodes.SUCCESS_CACHE) {
                if (acct != null) {
                    new AsyncTask<Void, Void, Void>() {
                        @Override
                        protected Void doInBackground(Void... params) {
                            googleToken = getGoogleToken();
                            SignUpViewModel signUpViewModel = new SignUpViewModel.Builder()
                                    .fullName(acct.getDisplayName())
                                    .login(acct.getEmail())
                                    .accessToken(googleToken)
                                    .socialIDP(Constants.GOOGLE_SOCIAL_SOURCE)
                                    .build();
                            fieldLoginView.onSuccessFetchToken(signUpViewModel);
                            return null;
                        }
                    }.execute();
                }
            } else if (resultCode == GoogleSignInStatusCodes.SIGN_IN_CANCELLED) {
                fieldLoginView.onErrorSignin(fieldLoginView.getContext().getString(R.string
                        .ss_err_13_fb_user_cancelled));
            } else {
                String message = GoogleSignInStatusCodes.getStatusCodeString(resultCode);
                if (!TextUtils.isEmpty(message)) {
                    fieldLoginView.onErrorSignin(message);
                } else
                    fieldLoginView.onErrorSignin(fieldLoginView.getContext().getString(R.string
                            .ss_err_13_fb_user_cancelled));
            }

        }
    }

I have gone through the below links multiple times and check each steps multiple times, but all in vain.

New Google sign in Android

Error 12501 authenticating with google sign-in

Here if I am using the google-service.JSON downloaded from my own account(test account, my local system's fingerprint is configured) its working fine. But if I am using the developer account(an account existing previously in which plus API was integrated) it's not working.

Feel free to ask more details. I am struggling with this issue from last 4-5 days:( .

ManMohan
  • 193
  • 1
  • 3
  • 13

1 Answers1

0

I got the same issue...

This may be due to Sha-1 and Sha-256 release and debug key mismatch.

Add all three(Debug: Sha-1, Release: Sha-1 and Sha-256) keys into the firebase console then re-download the json and replace.

It works fine for me.

Some times the OAuth 2.0 client IDs(Web application key) may be mismatched