title: com.google.android.gms.common.api.ApiException: 12500
body: <p>This is my first attempt.... trying to find the issue for last 2 days.
  I am trying to integrate google sign in to android app, however getting below:
  com.google.android.gms.common.api.ApiException: 12500</p>
  
  <p>Followed the code from:
  <a href="https://firebase.google.com/docs/auth/android/google-signin" rel="nofollow noreferrer">https://firebase.google.com/docs/auth/android/google-signin</a></p>
  
  <ul>
  <li><p>Made sure oauth client id is present in dev console with correct SHA-1 fingerprint from ~/.android/debug.keystore as suggested in other posts.</p></li>
  <li><p>Using latest play services 49 and in build.gradle at app level:    implementation 'com.google.android.gms:play-services-auth:16.0.1'</p></li>
  <li><p>Using below in project level build.gradle:</p></li>
  </ul>
  
  <h2>buildscript { // ... dependencies { // ... classpath 'com.google.gms:google-services:4.1.0' // google-services plugin } }</h2>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>public class SignUpActivity extends AppCompatActivity {
  
  private GoogleSignInClient gsc;
  
  private FirebaseAuth firebaseAuth;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_signup);
      GoogleSignInOptions gso = new GoogleSignInOptions
        .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestIdToken(String.valueOf(R.string.gplus_api_client_id))
        .requestEmail()
        .build();
  
      gsc = GoogleSignIn.getClient(this, gso);
  
      //Initialize firebase authentication
      firebaseAuth = FirebaseAuth.getInstance();
    }
  
  
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
      // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
      if (requestCode == RC_SIGN_IN) {
        // The Task returned from this call is always completed, no need to attach
        // a listener.
        Task &lt; GoogleSignInAccount &gt; task = GoogleSignIn.getSignedInAccountFromIntent(data);
  
        handleSignInResult(task);
      }
    }
    private void handleSignInResult(Task &lt; GoogleSignInAccount &gt; completedTask) {
      try {
        //Sign in Successful
        GoogleSignInAccount account = completedTask.getResult(ApiException.class);
        Log.w("SignUpActivity/handleSignInResult", "Trying signing in with Google...  " + account);
        firebaseAuthWithGoogle(account);
  
        // Signed in successfully, show authenticated UI.
  
        // Log.w("SignUpActivity/handleSignInResult", "Google sign in successful for account " + account);
  
      } catch (ApiException e) {
        // The ApiException status code indicates the detailed failure reason.
        // Please refer to the GoogleSignInStatusCodes class reference for more information.
        Log.w("SignUpActivity/handleSignInResult", "Google sign in failed with exception: " + e);
      }
    }
  
    private void firebaseAuthWithGoogle(GoogleSignInAccount account) {
      Log.i("SignUpActivity/firebaseAuthWithGoogle", "Signed in as : " + account.getId());
  
      AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken(), null);
  
      firebaseAuth.signInWithCredential(credential)
        .addOnCompleteListener(this, new OnCompleteListener &lt; AuthResult &gt; () {
          @Override
          public void onComplete(@NonNull Task &lt; AuthResult &gt; task) {
            if (task.isSuccessful()) {
              FirebaseUser user = firebaseAuth.getCurrentUser();
              Log.i("SignUpActivity/firebaseAuthWithGoogle", "Sign in successful for user : " + user);
            } else {
              Log.e("SignUpActivity/firebaseAuthWithGoogle", "User Authentication failed.");
              Snackbar.make(findViewById(R.id.view_signup), "Authentication failed.", Snackbar.LENGTH_SHORT);
            }
          }
        });
    }
  }</code></pre>
  </div>
  </div>
  </p>