在Firebase中进行用户注册时遇到问题 [英] Trouble with user registration in Firebase

查看:170
本文介绍了在Firebase中进行用户注册时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功连接到firebase并添加了所有必需的依赖项,但是我无法向其中注册用户.我在图中编写的代码也提供了gradle依赖项列表,请检查我在哪里出问题了

I've successfully connected to firebase and added all required dependencies but i am unable to register users into it.The code I wrote is in this picture I've also provided the gradle dependencies list please check where i am going wrong

我编写的代码

我已经在firebase中启用了电子邮件和密码验证,但是它不起作用.

I've enabled email and password verification in firebase yet it doesnt work.

这是我的依赖项列表.

 dependencies 
 {
   implementation fileTree(dir: 'libs', include: ['*.jar'])
   implementation 'com.android.support:support-v4:28.0.0'
   implementation 'com.google.firebase:firebase-core:16.0.9'
   implementation 'com.android.support:design:28.0.0'
   implementation 'com.google.firebase:firebase-database:16.0.1'
   implementation 'com.google.firebase:firebase-auth:17.0.0'
   implementation 'com.android.support:cardview-v7:28.0.0'
   implementation 'com.rengwuxian.materialedittext:library:2.1.4'
   implementation 'com.android.support.constraint:constraint-layout:1.1.3'
   testImplementation 'junit:junit:4.12'
   androidTestImplementation 'com.android.support.test:runner:1.0.2'
   androidTestImplementation 'com.android.support.test.espresso:espresso- 
   core:3.0.2'
 }

apply plugin: 'com.google.gms.google-services'

推荐答案

在社区帮助您解决问题之前,您需要提供更多信息.

You'd need to give more information before the community can help solve your problem for you.

要获取更多信息,我建议注销并共享该异常.在代码的else {}块中添加以下行:

To get more information, I'd suggest logging out the exception and sharing it. Add the following line in the else{} block of your code:

Log.w(TAG, "createUserWithEmail:failure", task.getException());

看起来像这样(我无法复制粘贴您的代码,因为它是一幅图像-将您的代码作为文本共享在问题中总是有帮助的,以便其他人可以复制和更正它)

So it looks something like this (I wasn't able to copy paste your code because it was an image - it's always helpful to share your code as text in questions so others can copy and correct it):

 mAuth.createUserWithEmailAndPassword(email, password)
                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                    @Override
                    public void onComplete(@NonNull Task<AuthResult> task) {
                        if (task.isSuccessful()) {
                            // your code here
                        } else {
                            //your toast here                               
                Log.w(TAG,"createUserWithEmail:failure",task.getException());
                        }

已注销的错误可以在Android Studio底部的Logcat部分中找到:

The logged out error can be found in the Logcat section at the bottom of Android Studio:

谢谢

这篇关于在Firebase中进行用户注册时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆