android - Firebase 电子邮件/密码身份验证从未完成

标签 android firebase firebase-authentication

我在我的 Android 应用程序中实现了 Firebase 提供的电子邮件/密码登录方法。它工作正常。但是今天由于我不知道的某些原因它没有用。我没有更改任何与我的登录 Activity 相关的代码,也没有更改我的 Firebase 控制台中的设置。

enter image description here

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]
}

在 Logcat 中,它显示程序确实到达了登录方法,但不知何故身份验证过程从未完成(日志从未显示 signInWithEmail:success 或 signInWithEmail:failure)。

enter image description here

我确实尝试过其他解决方案,例如将 addOnCompleteListener 更改为 addOnSuccessListener,但没有任何改变。 Firebase 服务目前不工作吗?还是我的代码有问题?我完全迷路了。感谢您分享任何想法。

最佳答案

我设法通过创建一个带有 x86_64 SDK 的新模拟器 使其再次运行。我认为这与 this question 有关和 this question

关于android - Firebase 电子邮件/密码身份验证从未完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53915563/

相关文章:

android - Google+ API 应用准备就绪

android - <activity-alias> 的快捷方式在 Jelly Bean 上消失了

java - ViewPager 在运行后按下新 Activity 时崩溃

firebase - 为什么我的 Firebase 查询返回错误的顺序?

Firebase 身份验证电子邮件自定义

android - 我无法在 Firebase 中重新验证或撤销用户的访问 token

android - ionic 2 : While deploying an IONIC app to android device : Task 'wrapper' not found in root project 'android'

firebase - 我应该将 firebase api key 隐藏到后端吗?不是因为数据安全,而是项目克隆问题

firebase - Google Services.json不存在

android - 我有适配器问题。任何人都可以知道解决方案