1

I am getting this strange error 12500 (sometimes 12502) code while google login. I saw some posts related to 12501 code and none seemed helpful. Also tried adding requestIdToken(web_client_id), no use. Please help!

I logged the response status, here it is:

Status{statusCode=unknown status code: 12500, resolution=null}

TIA

Sandeep Malik
  • 1,972
  • 1
  • 8
  • 17
Sandesh Baliga
  • 579
  • 5
  • 20

4 Answers4

2

you can follow this link and you will get a SHA from play store console and update it on your firebase console :-https://www.appdome.com/no-code-mobile-integration-knowledge-base/extracting-a-sha-1-fingerprint-from-the-google-play-app-signing-certificate/

and then you don't need to update a new apk on your console.

there will be 3 SHA1 on your firebase console :-

1) Debug SHA1. 2) Release SHA1. 3) Play Store Console SHA1.

Sandeep Malik
  • 1,972
  • 1
  • 8
  • 17
1

Turns out, somehow in Google API Console, It was asking for OAuth consent, and it was showing a popup to complete applying the same. I clicked on that dialog and did few procedures. You'll have to enter

  • Email Address
  • App icon
  • Domain url
  • Terms URL for your website
  • Privacy policy for your website

Then file the consent, After success and after a few minutes, Google login should work well.

Cheers.

Sandesh Baliga
  • 579
  • 5
  • 20
0

Actually, I had the same issue recently later I got know that the google play service version is not updated. By this question in stack overflow https://stackoverflow.com/a/47645136/7352857

So I had to do this in the onActivityResult,

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

    if (requestCode == GOOGLE_SIGNIN_ID){
        Task<GoogleSignInAccount> googleSignInAccountTask = GoogleSignIn.getSignedInAccountFromIntent(data);
        try {

            GoogleSignInAccount googleSignInAccount = googleSignInAccountTask.getResult(ApiException.class);
            fireBaseAuthenticationWithGoogle(googleSignInAccount);

        }catch (ApiException e){

            //if user doesn't have updated google play services version

            if (e.getStatusCode() == 12500){

                try{
                    // show your own AlertDialog for example:
                    AlertDialog.Builder builder = new AlertDialog.Builder(this);
                    // set the message
                    builder.setMessage("This app uses google play services for 
  signing in")
                            .setTitle("Do you want to update?");

                    builder.setPositiveButton("Ok", (dialog, id) -> {

                        //final String appPackageName = "com.google.android.gms";
                        final String appPackageName = 
                    "com.google.android.gms&hl=en_IN";
                        try {
                            startActivity(new Intent(Intent.ACTION_VIEW, 
               Uri.parse("market://details?id=" + appPackageName)));
                        }catch (android.content.ActivityNotFoundException anfe) {
                            startActivity(new Intent(Intent.ACTION_VIEW, 
                Uri.parse("https://play.google.com/store/apps/details?id=" + 
             appPackageName)));
                        }
                    });
                    builder.setNegativeButton("Cancel", new 
                    DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            // User cancelled the dialog
                        }
                    });
                    AlertDialog dialog = builder.create();
                    dialog.show();
                }catch (Exception err){
                    err.printStackTrace();
                }

            }
        }
    }else {
        // Pass the activity result back to the Facebook SDK
        mCallbackManager.onActivityResult(requestCode, resultCode, data);
    }

Try this and let me know if you have query.I solved this error by this method.

Brahma Datta
  • 1,102
  • 1
  • 12
  • 20
0

RELEASE:

  1. In android studio. Build -> Generate Signed APK... and click Next
  2. Copy your key store path and key alias.
  3. Open terminal and enter:

    keytool -list -v -keystore "key store path" -alias "key alias"

  4. Enter your key password and this will print out your release SHA1.

Put that SHA1 key into wherever it needed

refere: How to create SHA1 for Release