仅限管理员 - 匿名身份验证 - Firebase - Android

Admin only - Anonymous Authentication - Firebase - Android

我正在尝试使用 Firebase 向我的应用程序添加匿名身份验证。但是这个错误不断发生:

这是我的代码:

firebaseAuth.signInAnonymously()
    .addOnCompleteListener(task -> {
        if (task.isSuccessful()) {
            // Sign in success, update UI with the signed-in user's information
            FirebaseUser user = firebaseAuth.getCurrentUser();
            updateUI(user);
        } else {
            // If sign in fails, display a message to the user.
            Toast.makeText(AnonymousLoginActivity.this, task.getException().getMessage(),
                    Toast.LENGTH_SHORT).show();
            updateUI(null);
        }
    });

我该如何解决这个问题?

在 Firebase 中启用匿名登录。