title: Firebase User Login Calls Login Failed on Android App
body: <p>First of all, I have checked. I did not find any answers.. I was making an Android app using Firebase Authentication. I was following a tutorial on adding the authentication. I know that I have created users with the right password. And when I enter the password, the login fails ALL the time.</p>
  
  <p>Images:
  <a href="https://i.stack.imgur.com/SX4Kx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SX4Kx.png" alt="user password in firebase"></a></p>
  
  <p><a href="https://i.stack.imgur.com/X2Mob.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2Mob.png" alt="failing to log in. EVEN WITH THE RIGHT DETAILS!"></a></p>
  
  <p>Image links:
  <a href="https://drive.google.com/file/d/1FjcXT4FuGxxaW3ToUL_JkEWxbqj6w46q/view?usp=sharing" rel="nofollow noreferrer">one image</a>
  <a href="https://drive.google.com/file/d/12zJY9Zm3Kh1SboE4OTxw44eCNmVJpa7M/view?usp=sharing" rel="nofollow noreferrer">another image</a></p>
  
  <p>Code:</p>
  
  <pre><code>    package org.reliefdev.relief;
  
      import android.os.Bundle;
      import android.support.annotation.NonNull;
      import android.support.v7.app.AppCompatActivity;
      import android.view.View;
      import android.widget.EditText;
      import android.widget.TextView;
      import android.widget.Toast;
  
      import com.google.android.gms.tasks.OnCompleteListener;
      import com.google.android.gms.tasks.Task;
      import com.google.firebase.auth.AuthResult;
      import com.google.firebase.auth.FirebaseAuth;
      import com.google.firebase.auth.FirebaseUser;
      import com.google.firebase.database.DataSnapshot;
      import com.google.firebase.database.DatabaseError;
      import com.google.firebase.database.DatabaseReference;
      import com.google.firebase.database.FirebaseDatabase;
      import com.google.firebase.database.ValueEventListener;
  
      import static org.reliefdev.relief.PublicStuff.passwordString;
      import static org.reliefdev.relief.PublicStuff.usernameString;
  
      public class LoginActivity extends AppCompatActivity {
      private FirebaseAuth mAuth;
      private FirebaseAuth.AuthStateListener mAuthListener;
  
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_login);
  
          mAuth = FirebaseAuth.getInstance();
  
          TextView loginButton = findViewById(R.id.goLoginBtnLabel);
          final EditText loginUsername = findViewById(R.id.loginUsername);
          final EditText loginPassword = findViewById(R.id.loginPassword);
  
  
  
          loginButton.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  //Set the public variables to something.
                  usernameString = loginUsername.getText().toString();
                  passwordString = loginPassword.getText().toString();
  
                  //All logic for the text boxes/EditTexts.
                  if (!usernameString.equals("") &amp;&amp; !passwordString.equals("")) {
  
                      //To actually log the user in!
                      mAuth.signInWithEmailAndPassword(usernameString, passwordString)
                              .addOnCompleteListener(LoginActivity.this, new OnCompleteListener&lt;AuthResult&gt;() {
                                  @Override
                                  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                                      if (task.isSuccessful()) {
                                          //Login has completed properly (the username and password are correct)
                                          Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_welcome_login) + " " + loginUsername.getText().toString() + getResources().getString(R.string.excla), Toast.LENGTH_SHORT).show();
                                      } else {
                                          Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_please_check_sign_in_info_details), Toast.LENGTH_SHORT).show();
                                      }
                                  }
                              });
                  }  /*if (usernameString.equals("")) {
                      Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_please_enter_a_username), Toast.LENGTH_SHORT).show();
                  }  if (!usernameString.equals("") &amp;&amp; passwordString.equals("")) {
                      Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_username_but_need_pass), Toast.LENGTH_SHORT).show();
                  }  if (usernameString.equals("") &amp;&amp; passwordString.equals("")) {
                      Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_need_both_pass_and_username), Toast.LENGTH_SHORT).show();
                  }*/
              }
          });
  
          mAuthListener = new FirebaseAuth.AuthStateListener() {
              @Override
              public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
                  FirebaseUser user = firebaseAuth.getCurrentUser();
  
                  if (user != null) {
                      //The user is signed in
                      // startActivity(new Intent(LoginActivity.this, HomeActivity.class));
                  } else {
                      //The user is signed out
  
                  }
              }
          };
  
  
      }
  
      public void onBackPressed() {
          Toast.makeText(LoginActivity.this, getResources().getString(R.string.login_toast_on_back_pressed), Toast.LENGTH_SHORT).show();
      }
  
      @Override
      protected void onStart() {
          super.onStart();
  
          mAuth.addAuthStateListener(mAuthListener);
      }
  
      @Override
      protected void onStop() {
          super.onStop();
  
          if (mAuth != null) {
              mAuth.removeAuthStateListener(mAuthListener);
          }
      }
  }
  </code></pre>
  
  <p>And the <code>logcat</code></p>
  
  <pre><code>01-05 22:57:15.445 8070-8070/? I/zygote: Not late-enabling -Xcheck:jni (already on)
  01-05 22:57:15.457 8070-8070/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
  01-05 22:57:15.860 8070-8070/org.reliefdev.relief W/zygote: Unsupported class loader
  01-05 22:57:15.861 8070-8070/org.reliefdev.relief W/zygote: Skipping duplicate class check due to unsupported classloader
  01-05 22:57:15.871 8070-8070/org.reliefdev.relief W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
  01-05 22:57:15.884 8070-8070/org.reliefdev.relief W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
  01-05 22:57:15.909 8070-8070/org.reliefdev.relief I/BiChannelGoogleApi: [FirebaseAuth: ] No Fallback module; NOT setting up for lazy initialization
  01-05 22:57:15.930 8070-8070/org.reliefdev.relief D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
  01-05 22:57:15.942 8070-8087/org.reliefdev.relief W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
  01-05 22:57:15.949 8070-8087/org.reliefdev.relief I/FirebaseAuth: [FirebaseAuth:] Loading module via FirebaseOptions.
  01-05 22:57:15.949 8070-8087/org.reliefdev.relief I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
  01-05 22:57:15.988 8070-8070/org.reliefdev.relief V/FA: Cancelling job. JobID: 1388094817
  01-05 22:57:16.008 8070-8070/org.reliefdev.relief V/FA: Registered activity lifecycle callback
  01-05 22:57:16.011 8070-8070/org.reliefdev.relief I/FirebaseInitProvider: FirebaseApp initialization successful
  01-05 22:57:16.013 8070-8070/org.reliefdev.relief I/InstantRun: starting instant run server: is main process
  01-05 22:57:16.039 8070-8090/org.reliefdev.relief V/FA: Collection enabled
  01-05 22:57:16.039 8070-8090/org.reliefdev.relief V/FA: App package, google app id: org.reliefdev.relief, 1:982107279652:android:dc8fd1d87ede636d
  01-05 22:57:16.040 8070-8090/org.reliefdev.relief I/FA: App measurement is starting up, version: 11910
  01-05 22:57:16.040 8070-8090/org.reliefdev.relief I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
  01-05 22:57:16.040 8070-8090/org.reliefdev.relief I/FA: To enable faster debug mode event logging run:
                                                            adb shell setprop debug.firebase.analytics.app org.reliefdev.relief
  01-05 22:57:16.040 8070-8090/org.reliefdev.relief D/FA: Debug-level message logging enabled
  01-05 22:57:16.087 8070-8090/org.reliefdev.relief V/FA: Connecting to remote service
  01-05 22:57:16.103 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.140 8070-8070/org.reliefdev.relief V/FA: onActivityCreated
  01-05 22:57:16.368 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.375 8070-8090/org.reliefdev.relief V/FA: Activity resumed, time: 3510863
  01-05 22:57:16.388 8070-8090/org.reliefdev.relief I/FA: Tag Manager is not found and thus will not be used
  01-05 22:57:16.392 8070-8090/org.reliefdev.relief D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=WelcomeActivity, firebase_screen_id(_si)=850490102224929754}]
  01-05 22:57:16.412 8070-8095/org.reliefdev.relief D/OpenGLRenderer: HWUI GL Pipeline
  01-05 22:57:16.450 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.465 8070-8090/org.reliefdev.relief V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 83
  01-05 22:57:16.465 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.465 8070-8090/org.reliefdev.relief V/FA: Activity paused, time: 3510921
  01-05 22:57:16.492 8070-8070/org.reliefdev.relief V/FA: onActivityCreated
  01-05 22:57:16.583 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.584 8070-8090/org.reliefdev.relief V/FA: Activity resumed, time: 3511072
  01-05 22:57:16.597 8070-8090/org.reliefdev.relief D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=WelcomeActivity, firebase_previous_id(_pi)=850490102224929754, firebase_screen_class(_sc)=LoginActivity, firebase_screen_id(_si)=850490102224929755}]
  01-05 22:57:16.670 8070-8075/org.reliefdev.relief I/zygote: Do partial code cache collection, code=16KB, data=21KB
  01-05 22:57:16.671 8070-8090/org.reliefdev.relief V/FA: Connection attempt already in progress
  01-05 22:57:16.671 8070-8075/org.reliefdev.relief I/zygote: After code cache collection, code=16KB, data=22KB
  01-05 22:57:16.671 8070-8075/org.reliefdev.relief I/zygote: Increasing code cache capacity to 128KB
  01-05 22:57:16.676 8070-8075/org.reliefdev.relief I/zygote: Do partial code cache collection, code=16KB, data=40KB
  01-05 22:57:16.677 8070-8075/org.reliefdev.relief I/zygote: After code cache collection, code=16KB, data=40KB
  01-05 22:57:16.677 8070-8075/org.reliefdev.relief I/zygote: Increasing code cache capacity to 256KB
  01-05 22:57:16.677 8070-8075/org.reliefdev.relief I/zygote: JIT allocated 71KB for compiled code of void android.widget.TextView.&lt;init&gt;(android.content.Context, android.util.AttributeSet, int, int)
  01-05 22:57:16.677 8070-8075/org.reliefdev.relief I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.&lt;init&gt;(android.content.Context, android.util.AttributeSet, int, int)
  
                                                              [ 01-05 22:57:16.692  8070: 8095 D/         ]
                                                              HostConnection::get() New Host Connection established 0x981fa380, tid 8095
  01-05 22:57:16.704 8070-8095/org.reliefdev.relief I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
  01-05 22:57:16.705 8070-8095/org.reliefdev.relief I/OpenGLRenderer: Initialized EGL, version 1.4
  01-05 22:57:16.705 8070-8095/org.reliefdev.relief D/OpenGLRenderer: Swap behavior 1
  01-05 22:57:16.705 8070-8095/org.reliefdev.relief W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
  01-05 22:57:16.705 8070-8095/org.reliefdev.relief D/OpenGLRenderer: Swap behavior 0
  01-05 22:57:16.708 8070-8095/org.reliefdev.relief D/EGL_emulation: eglCreateContext: 0xa8004720: maj 2 min 0 rcv 2
  01-05 22:57:16.715 8070-8095/org.reliefdev.relief D/EGL_emulation: eglMakeCurrent: 0xa8004720: ver 2 0 (tinfo 0xa8003640)
  01-05 22:57:16.758 8070-8090/org.reliefdev.relief D/FA: Connected to remote service
  01-05 22:57:16.758 8070-8090/org.reliefdev.relief V/FA: Processing queued up service tasks: 7
  01-05 22:57:16.781 8070-8095/org.reliefdev.relief D/EGL_emulation: eglMakeCurrent: 0xa8004720: ver 2 0 (tinfo 0xa8003640)
  01-05 22:57:17.008 8070-8070/org.reliefdev.relief V/View: dispatchProvideAutofillStructure(): not laid out, ignoring 0 children of 1073741834
  01-05 22:57:17.014 8070-8070/org.reliefdev.relief I/AssistStructure: Flattened final assist data: 3392 bytes, containing 1 windows, 12 views
  01-05 22:57:22.075 8070-8090/org.reliefdev.relief V/FA: Inactivity, disconnecting from the service
  01-05 22:57:29.658 8070-8075/org.reliefdev.relief I/zygote: Do full code cache collection, code=125KB, data=80KB
  01-05 22:57:29.659 8070-8075/org.reliefdev.relief I/zygote: After code cache collection, code=122KB, data=52KB
  01-05 22:57:32.925 8070-8070/org.reliefdev.relief V/View: dispatchProvideAutofillStructure(): not laid out, ignoring 0 children of 1073741834
  01-05 22:57:32.937 8070-8070/org.reliefdev.relief I/AssistStructure: Flattened final assist data: 3456 bytes, containing 1 windows, 12 views
  01-05 22:57:34.930 8070-8075/org.reliefdev.relief I/zygote: Do partial code cache collection, code=124KB, data=64KB
  01-05 22:57:34.931 8070-8075/org.reliefdev.relief I/zygote: After code cache collection, code=124KB, data=64KB
  01-05 22:57:34.932 8070-8075/org.reliefdev.relief I/zygote: Increasing code cache capacity to 512KB
  01-05 22:57:41.230 8070-8070/org.reliefdev.relief W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms
  01-05 22:57:42.079 8070-8095/org.reliefdev.relief D/EGL_emulation: eglMakeCurrent: 0xa8004720: ver 2 0 (tinfo 0xa8003640)
  01-05 22:57:42.296 8070-8095/org.reliefdev.relief D/EGL_emulation: eglMakeCurrent: 0xa8004720: ver 2 0 (tinfo 0xa8003640)
  </code></pre>