Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/183.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 单击“注册”按钮时应用程序崩溃(使用firebase)_Java_Android_Firebase_Firebase Authentication - Fatal编程技术网

Java 单击“注册”按钮时应用程序崩溃(使用firebase)

Java 单击“注册”按钮时应用程序崩溃(使用firebase),java,android,firebase,firebase-authentication,Java,Android,Firebase,Firebase Authentication,每当我点击登录页面上的注册按钮时,我的应用程序就会崩溃,无法进入下一个活动。我已经被困在这个问题上一天了,似乎在任何地方都找不到解决方案 下面是我为注册按钮方法编写的代码。 (emailText和passwordText是文本输入布局) 就我的情况而言,我更新了firebase实时数据库的最新版本,问题得到了解决 implementation 'com.google.firebase:firebase-database:19.5.1' 是否确定:如果(!validatePassword()|!

每当我点击登录页面上的注册按钮时,我的应用程序就会崩溃,无法进入下一个活动。我已经被困在这个问题上一天了,似乎在任何地方都找不到解决方案

下面是我为注册按钮方法编写的代码。 (
emailText
passwordText
是文本输入布局)


就我的情况而言,我更新了firebase实时数据库的最新版本,问题得到了解决

implementation 'com.google.firebase:firebase-database:19.5.1'

是否确定:如果(!validatePassword()|!validateEmail()){return;}??可能您打算使用| |而不是“|”,这证明了“第七行”错误可能是:)不,我打算使用“|”运算符而不是“| |”运算符。若语句执行成功,则第7行在else语句中。“|”当您希望同时调用函数
validatePassword()
validateEmail()
时使用。如果使用“| |”运算符,它将调用第一个函数;如果第一个函数返回true,则执行If语句,它将不调用第二个函数。
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@1a7dad29 rejected from com.google.firebase.database.core.utilities.DefaultRunLoop$1@28fb68ae[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
        at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:298)
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:503)
        at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:592)
        at com.google.firebase.database.core.utilities.DefaultRunLoop.scheduleNow(com.google.firebase:firebase-database@@16.0.6:105)
        at com.google.firebase.database.core.Repo.scheduleNow(com.google.firebase:firebase-database@@16.0.6:276)
        at com.google.firebase.database.Query.addEventRegistration(com.google.firebase:firebase-database@@16.0.6:233)
        at com.google.firebase.database.Query.addListenerForSingleValueEvent(com.google.firebase:firebase-database@@16.0.6:175)
        at com.example.admin.instagramclone.MainActivity.signup(MainActivity.java:66)
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:384) 
        at android.view.View.performClick(View.java:4791) 
        at android.view.View$PerformClick.run(View.java:19903) 
        at android.os.Handler.handleCallback(Handler.java:739) 
        at android.os.Handler.dispatchMessage(Handler.java:95) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5296) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707) 
implementation 'com.google.firebase:firebase-database:19.5.1'