title: Android Google Sign In Failed com.google.android.gms.common.api.ApiException: 12500
body: <p>So I'm trying to use Google Sign In Authentication using Firebase as provide by this link :
  <a href="https://firebase.google.com/docs/auth/android/google-signin?hl=en" rel="nofollow noreferrer">https://firebase.google.com/docs/auth/android/google-signin?hl=en</a></p>
  
  <p>I followed every single step including putting my <code>SHA-1 Fingerprint</code> into the firebase project. I'm currently on debug mode so I only have one <code>SHA-1 Fingerprint</code>. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login);
  
      GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
              .requestIdToken(getString(R.string.client_id))
              .requestEmail()
              .build();
  
      mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
  
  
      mAuth = FirebaseAuth.getInstance();
  
      LinearLayout gLog = (LinearLayout) findViewById(R.id.googleLogin);
      gLog.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              signIn();
          }
      });
  
  }
  
  private void signIn() {
      Intent signInIntent = mGoogleSignInClient.getSignInIntent();
      startActivityForResult(signInIntent, RC_SIGN_IN);
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
      if (requestCode == RC_SIGN_IN) {
          Task&lt;GoogleSignInAccount&gt; task = GoogleSignIn.getSignedInAccountFromIntent(data);
  
          try {
              // Google Sign In was successful, authenticate with Firebase
              GoogleSignInAccount account = task.getResult(ApiException.class);
              firebaseAuthWithGoogle(account);
          } catch (ApiException e) {
              // Google Sign In failed, update UI appropriately
              Log.w("Error", "Google sign in failed", e);
              // ...
          }
      }
  }
  
  private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
      Log.d("Akun", "firebaseAuthWithGoogle:" + acct.getId());
      AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
      mAuth.signInWithCredential(credential)
              .addOnCompleteListener(this, new OnCompleteListener&lt;AuthResult&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                      if (task.isSuccessful()) {
                          // Sign in success, update UI with the signed-in user's information
                          Log.d("MsgFirebase", "signInWithCredential:success");
                          FirebaseUser user = mAuth.getCurrentUser();
                          Intent i = new Intent(login_activity.this, main_activity.class);
                          i.putExtra("nama", user.getDisplayName());
                          i.putExtra("email", user.getEmail());
                          startActivity(i);
                      } else {
                          // If sign in fails, display a message to the user.
                          Log.w("MsgFirebase", "signInWithCredential:failure", task.getException());
                      }
  
                      // ...
                  }
              });
  }
  </code></pre>
  
  <p>And here's the error that I got : </p>
  
  <pre><code>com.google.android.gms.common.api.ApiException: 12500: 
      at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source)
      at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
      at com.mfs.rumah_duka.login_activity.onActivityResult(login_activity.java:112)
      at android.app.Activity.dispatchActivityResult(Activity.java:6562)
      at android.app.ActivityThread.deliverResults(ActivityThread.java:3752)
      at android.app.ActivityThread.handleSendResult(ActivityThread.java:3799)
      at android.app.ActivityThread.access$1500(ActivityThread.java:154)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:157)
      at android.app.ActivityThread.main(ActivityThread.java:5555)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
      at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:118)
  </code></pre>
  
  <p>I tried to check if the resultCode from the <code>SigningIntent</code> is success. It turns our it's not <code>Activity.RESULT_OK</code>.
  I got the error right after I choose an account on the Sign In window.</p>
  
  <p><strong>Solutions that I've tried :</strong></p>
  
  <ul>
  <li>Changed web client ID in the Firebase Google Sign In setting to the
  one from my Oath credential in my Cloud Console</li>
  <li>Updated my gms service library to the latest version (According to <a href="https://stackoverflow.com/questions/47632035/google-sign-in-error-12500">Google Sign In error 12500</a>)</li>
  <li>Create an OAuth for Android in my Cloud Console</li>
  </ul>
  
  <p>None of those gave me a solution. I tried to read the documentation as to what error code <code>12500</code> means but it seems there's no specific cause. It says that try to use another email and it's still the same.</p>
  
  <p>Does anybody has any solution to this?</p>