title: Google SignIn failed while using Firebase Auth
body: <p>I am getting the following error after selecting an account after pressing the google sign in button.</p>
  <pre><code>com.google.android.gms.common.api.ApiException: 10: 
          at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@17.1.0:4)
          at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(com.google.android.gms:play-services-auth@@19.0.0:9)
          at inspire2connect.inspire2connect.home.LoginActivity.onActivityResult(LoginActivity.java:125)
          at android.app.Activity.dispatchActivityResult(Activity.java:8310)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:5008)
          at android.app.ActivityThread.handleSendResult(ActivityThread.java:5056)
          at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:223)
          at android.app.ActivityThread.main(ActivityThread.java:7656)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
  </code></pre>
  <p>The app I am working on is already on the PlayStore. I am trying to implement a sign-in/up method for the users but I am facing problems while doing so.</p>
  <p>The credentials on the Google Play console are say, SHA1: <code>x</code> (for readability and privacy), SHA256: <code>x1</code></p>
  <p>The credentials I got on running the <code>signingReport</code> are, SHA1: <code>y</code> and SHA256: <code>y1</code></p>
  <p>The credentials on the Google Console Cloud are, SHA1: <code>x</code>(same as the first one) and WebClientID: <code>z</code></p>
  <p>The keys uploaded on the firebase console are: <code>x, x1, y, y1</code> (all are uploaded)</p>
  <p>The client ID I use while calling in <code>GoogleSignInOptions.Builder</code> is <code>z</code></p>
  <p>The code for LogIn activity is :</p>
  <pre><code>public class LoginActivity extends BaseActivity implements View.OnClickListener{
  
      private ConstraintLayout signInButton;
      private GoogleSignInClient mGoogleSignInClient;
      private  String TAG = &quot;LoginActivity&quot;;
      private FirebaseAuth mAuth;
      private int RC_SIGN_IN = 1;
      private static final int MY_REQUEST_CODE = 2399;
      ConstraintLayout[] ll_but = new ConstraintLayout[10];
      ProgressDialog progressDialog;
  
      @Override
      protected void attachBaseContext(Context newBase) {
          super.attachBaseContext(newBase);
      }
  
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setStatusBarGradiant(this);
          setContentView(R.layout.activity_login);
          getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
          progressDialog= new ProgressDialog(LoginActivity.this);
          progressDialog.setTitle(&quot;Please Wait..&quot;);
          progressDialog.setMessage(&quot;Loading&quot;);
          progressDialog.setCancelable(false);
          progressDialog.show();
  
          mAuth = FirebaseAuth.getInstance();
  
          ll_but[0] = findViewById(R.id.email_login_tile);
          ll_but[1] = findViewById(R.id.phone_login_tile);
          ll_but[2] = findViewById(R.id.google_login_tile);
  
  
          int[] btnToAdd = new int[]{0, 1, 2};
  
          for (int i = 0; i &lt; btnToAdd.length; i++) {
              ll_but[btnToAdd[i]].setOnClickListener(this);
          }
  
          FirebaseUser user = mAuth.getCurrentUser();
          if (user != null) {
              progressDialog.dismiss();
              startActivity(new Intent(LoginActivity.this, homeActivity.class));
          }
          progressDialog.dismiss();
  
          signInButton = findViewById(R.id.google_login_tile);
  
          GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                  .requestIdToken(&quot;1086619162320-po4o7git1lbllf86ukqfkvo2mh2ttsck.apps.googleusercontent.com&quot;)
                  .requestEmail()
                  .build();
  
          mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
  
  
      }
  
      @Override
      public void onClick(View view) {
          Intent i = null;
  
          switch(view.getId()){
              case R.id.google_login_tile:
                  signIn();
                  break;
  
              case R.id.email_login_tile:
                  i = new Intent(LoginActivity.this, EmailLogin.class);
                  startActivity(i);
                  break;
  
              case R.id.phone_login_tile:
                  i = new Intent(LoginActivity.this, PhoneLogin.class);
                  startActivity(i);
                  break;
          }
  
      }
  
      private void signIn(){
          Intent signInIntent = mGoogleSignInClient.getSignInIntent();
          startActivityForResult(signInIntent, RC_SIGN_IN);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, @Nullable 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);
                  Log.d(TAG, &quot;firebaseAuthWithGoogle:&quot; + account.getId());
                  firebaseAuthWithGoogle(account.getIdToken());
              } catch (ApiException e) {
                  // Google Sign In failed, update UI appropriately
                  Log.w(TAG, &quot;Google sign in failed&quot;, e);
                  // ...
              }
          }
      }
  
      private void firebaseAuthWithGoogle(String idToken) {
          AuthCredential credential = GoogleAuthProvider.getCredential(idToken, 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(TAG, &quot;signInWithCredential:success&quot;);
                              FirebaseUser user = mAuth.getCurrentUser();
                              Intent i = new Intent(LoginActivity.this, homeActivity.class);
                              startActivity(i);
                          } else {
                              // If sign in fails, display a message to the user.
                              Log.w(TAG, &quot;signInWithCredential:failure&quot;, task.getException());
                          }
  
                      }
                  });
      }
  
  
     
  }
  </code></pre>
  <p>Here's my gradle file:</p>
  <pre><code>apply plugin: 'com.android.application'
  apply plugin: 'com.google.firebase.crashlytics'
  
  android {
      compileSdkVersion 29
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      defaultConfig {
          applicationId &quot;inspire2connect.inspire2connect&quot;
          minSdkVersion 21
          targetSdkVersion 29
          versionCode 24
          versionName &quot;4.1&quot;
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
      buildTypes {
          release {
              minifyEnabled false
              debuggable false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      def room_version = &quot;2.2.5&quot;
      implementation fileTree(dir: 'libs', include: ['*.jar'])
  
      // Android &amp; UI
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test.ext:junit:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  //    implementation 'org.jetbrains:annotations-java5:15.0'
  
      implementation 'androidx.appcompat:appcompat:1.1.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'com.google.android.material:material:1.1.0'
      implementation 'com.google.android.play:core:1.7.3'
      implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
      implementation 'androidx.mediarouter:mediarouter:1.1.0'
      implementation 'androidx.recyclerview:recyclerview:1.1.0'
      implementation &quot;androidx.viewpager:viewpager:1.0.0&quot;
      implementation 'android.arch.work:work-runtime:1.0.1'
      implementation 'androidx.preference:preference:1.1.1'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'androidx.legacy:legacy-support-v13:1.0.0'
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
      implementation 'com.google.guava:guava:27.0.1-android'
      implementation 'com.android.volley:volley:1.1.1'
  
      // Firebase
      implementation platform('com.google.firebase:firebase-bom:26.3.0')
      implementation 'com.google.firebase:firebase-database:19.3.0'
      implementation 'com.firebaseui:firebase-ui-auth:6.2.0'
      implementation 'com.google.android.gms:play-services-auth:19.0.0'
      implementation 'com.google.android.gms:play-services-basement:17.5.0'
      implementation 'com.google.firebase:firebase-auth:19.3.1'
      implementation 'com.google.firebase:firebase-storage:19.1.1'
      implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.7'
      implementation 'com.google.firebase:firebase-analytics:17.4.3'
      implementation 'com.google.firebase:firebase-messaging:20.2.0'
      implementation 'com.google.firebase:firebase-core:17.4.3'
      implementation 'com.google.firebase:firebase-iid:20.2.0'
      implementation 'com.google.firebase:firebase-crashlytics:17.0.1'
  
      // Room
      implementation &quot;androidx.room:room-runtime:$room_version&quot;
      annotationProcessor &quot;androidx.room:room-compiler:$room_version&quot;
      testImplementation &quot;androidx.room:room-testing:$room_version&quot;
  
      // Third Party
      implementation 'io.branch.sdk.android:library:5.+'
      implementation 'com.squareup.picasso:picasso:2.71828'
      implementation 'com.github.lecho:hellocharts-library:1.5.8@aar'
      implementation 'com.llollox:androidtoggleswitch:2.0.1'
      implementation 'com.sefford:circular-progress-drawable:1.31@aar'
      implementation 'androidx.gridlayout:gridlayout:1.0.0'
      implementation 'com.jakewharton:butterknife:10.2.1'
      annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
      implementation 'in.srain.cube:grid-view-with-header-footer:1.0.12'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test.ext:junit:1.1.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
      implementation 'com.google.android.gms:play-services-maps:17.0.0'
      implementation 'com.google.firebase:firebase-analytics:17.2.2'
      implementation 'com.squareup.okhttp3:okhttp:4.4.0'
      implementation 'com.google.android.gms:play-services-location:17.0.0'
      implementation 'com.shobhitpuri.custombuttons:google-signin:1.1.0'
  //    implementation files('libs/YouTubeAndroidPlayerApi.jar')
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  <p>Where am I going wrong?</p>