小编aja*_*mar的帖子

firebase createUserWithEmailAndPassword在android中不起作用

我正在尝试使用该createUserWithEmailAndPassword方法来创建用户但不能这样做.正在调用OnAuthenticate方法,但用户对象为null,并且没有在firebase控制台内创建用户.这是我的代码,也是在线提供的代码.

MAinActivity.java

private static FirebaseAuth mAuth;
private static FirebaseAuth.AuthStateListener mAuthListener;
private static String TAG = "RegisterDEbug";
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.activity_main);
    mAuth = FirebaseAuth.getInstance();
    mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            waitForDebugger();
            FirebaseUser user = firebaseAuth.getCurrentUser();
            if (user != null) {
                // User is signed in
                Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
            } else {
                // User is signed out
                Log.d(TAG, "onAuthStateChanged:signed_out");
            }
            // ...
        }
    };
    mAuth.addAuthStateListener(mAuthListener);
    mAuth.createUserWithEmailAndPassword("9199999989@pintech.com", "corrfecthorsebatterystaple")
            .addOnCompleteListener(this, new …
Run Code Online (Sandbox Code Playgroud)

android createuser firebase

3
推荐指数
1
解决办法
8819
查看次数

标签 统计

android ×1

createuser ×1

firebase ×1