I implement email/password sign-in method provided by Firebase in my Android apps. It was working fine. But today it didn't work for some reasons unknown to me. I didn't change any codes related to my login activity and didn't change the settings in my Firebase console.
private void signIn(String email, String password) {
Log.d(TAG, "signIn:" + email);
if (!validateForm()) {
return;
}
showProgressDialog();
// [START sign_in_with_email]
firebaseAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(this, task -> {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d(TAG, "signInWithEmail:success");
FirebaseUser user = firebaseAuth.getCurrentUser();
updateUI(user);
} else {
// If sign in fails, display a message to the user.
Log.w(TAG, "signInWithEmail:failure", task.getException());
Toast.makeText(LoginActivity.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
}
hideProgressDialog();
});
// [END sign_in_with_email]
}
In the Logcat, it showed that the program did reach the sign in method, but somehow the authentication process never completed (the log never shows signInWithEmail:success or signInWithEmail:failure).
I did try other solution such as changing addOnCompleteListener to addOnSuccessListener but nothing changed. Is Firebase service currently not working? Or is there something wrong with my codes? I'm completely at lost. I appreciate any thoughts you'd like to share.