[英]Hello Dear, I attach my app with firbase adabase so it crashes. I have tried too much to sort out of this Problem but can't get rid of please help me
Well, looks like a classic problem of variable not initialized.好吧,看起来像是一个变量未初始化的经典问题。
In the stacktrace (the text reported back to you with the reason of the error) you got a NullPointerException
this means you have a place in your code with a variable pointing to nothing (aka null
).在堆栈跟踪(向您报告错误原因的文本)中,您得到了
NullPointerException
这意味着您的代码中有一个变量指向任何内容(又名null
)。
Usually when you define a variable in java like this:通常当您在 java 中定义一个变量时,如下所示:
String myVariable;
You are not assigning any value, which means the variable has null
information.您没有分配任何值,这意味着该变量具有
null
信息。 Then you cannot call methods or do anything with that variable.然后你不能调用方法或对该变量做任何事情。
Currently, for the screenshot you shared, that's your problem.目前,对于您共享的屏幕截图,这是您的问题。 My guess is that around line 271 when you try to access
Pinb.length()
your variable does not contain any value.我的猜测是,当您尝试访问
Pinb.length()
时,在第271行附近,您的变量不包含任何值。
So your problem is more about what you are trying to access and not a Firebase problem.因此,您的问题更多是关于您要访问的内容,而不是 Firebase 问题。 Check your code and check that it actually assigns a value to your variables before accessing them.
检查您的代码并在访问它们之前检查它是否确实为您的变量分配了一个值。 You can even check for a null and see that your code will compile:
您甚至可以检查 null 并查看您的代码是否可以编译:
if(Pinb.= null && Pinb.legnth() < 6) { //your code here... }
Also check your if
as usually if
statements does not end with ;
还要检查您的
if
通常if
语句不以;
结尾because that means something like: hey check this expression and do nothing .因为这意味着类似:嘿检查这个表达式并且什么都不做。
Check the billing plan.检查计费计划。
or:或者:
If you have no apps in your project: Click the icon for the app's platform, then follow the setup workflow.如果您的项目中没有应用程序:单击应用程序平台的图标,然后按照设置工作流程进行操作。
If you already have apps in your project: Click Add app, then follow the setup workflow.如果您的项目中已有应用程序:单击添加应用程序,然后按照设置工作流程进行操作。 Note that you can also add an app to your project from the console's main overview page of your Firebase project.
请注意,您还可以从 Firebase 项目的控制台主概览页面将应用程序添加到您的项目中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.