title: Firebase Login Error: Error logging in with Google
body: <p>I have a login screen in which you can login through Google, but when I click to login and then select the account, it stays in the same activity. The error in the Log is the following:</p>
  
  <pre><code>W/InputMethodManager: startInputReason = 1
  E/GoogleProvider: Error logging in with Google. 16 null
  EGLNativeWindowType 0x704a430010 disconnect failed
  Activity resumed, time: 182884358
  </code></pre>
  
  <p>The code of the activity is the following:</p>
  
  <pre><code>import android.content.Intent;
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  
  import com.firebase.ui.auth.AuthUI;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  
  import java.util.Arrays;
  
  public class LoginActivity extends AppCompatActivity {
  
      private static final int RC_SIGN_IN = 123;
      private FirebaseAuth mAuth;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder()
                          .setAvailableProviders(
                                  Arrays.asList(  new AuthUI.IdpConfig.GoogleBuilder().build(),
                                          new AuthUI.IdpConfig.FacebookBuilder().build()))
                          .setIsSmartLockEnabled(false)
                          .setTheme(R.style.AppTheme)
                          .build(),
                  RC_SIGN_IN);
  
          mAuth = FirebaseAuth.getInstance();
          mAuth.addAuthStateListener(firebaseAuth -&gt; {
              if(firebaseAuth.getCurrentUser()!= null) {
                  startHomeActivity();
              }
          });
      }
  
      @Override
      public void onStart() {
          super.onStart();
          FirebaseUser currentUser = mAuth.getCurrentUser();
          if(currentUser != null) {
              startHomeActivity();
          }
      }
  
      private void startHomeActivity() {
          Intent intent = new Intent(getApplicationContext(), Home.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
          startActivity(intent);
      }
  }
  </code></pre>
  
  <p>I already signed Firebase with SHA1 and activated the login options in the service.</p>