简体   繁体   English

Firebase 错误无法为 child() 中的参数“pathString”传递 null

[英]Firebase error Can't pass null for argument 'pathString' in child()

I try to make a Database Reference in firebase but after run the program it showed java.lang.NullPointerException: Can't pass null for argument 'path string' in the child() Please tell me the proper solution我尝试在 firebase 中创建数据库引用,但在运行程序后显示 java.lang.NullPointerException: Can't pass null for argument 'path string' in the child() 请告诉我正确的解决方案


String receiverUid, senderUid;
DatabaseReference reference;
FirebaseDatabase database = FirebaseDatabase.getInstance();


reference = database.getReference("vcResponse").child(senderUid).child(receiverUid);

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.griffindor.postapp/com.griffindor.postapp.activities.calling.InCallingActivity}: java.lang.NullPointerException: Can't pass null for argument 'pathString' in child()
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3175)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3312)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:113)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:71)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2038)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:226)
        at android.app.ActivityThread.main(ActivityThread.java:7178)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
     Caused by: java.lang.NullPointerException: Can't pass null for argument 'pathString' in child()
        at com.google.firebase.database.DatabaseReference.child(DatabaseReference.java:96)
        at com.griffindor.postapp.activities.calling.InCallingActivity.onCreate(InCallingActivity.java:74)
        at android.app.Activity.performCreate(Activity.java:7383)
        at android.app.Activity.performCreate(Activity.java:7374)

首先你需要保证receiverUid, senderUid是非空的首先你需要保证receiverUid, senderUid是非空的

First, you need to ensure that the receiverUid and senderUid are non empty首先需要保证receiverUid和senderUid不为空

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 参数“pathString”为空 - null for argument 'pathString' Flutter Dart Firebase 错误:function 不能无条件调用,因为它可以为“null” - Flutter Dart Firebase error: The function can't be unconditionally invoked because it can be 'null' FIREBASE 致命错误:无法确定 Firebase 数据库 URL - FIREBASE FATAL ERROR: Can't determine Firebase Database URL 未找到模块:错误:无法解析“./Firebase” - Module not found: Error: Can't resolve './Firebase' 无法将参数类型“Null”分配给参数类型“User” - The argument type 'Null' can't be assigned to the parameter type 'User' 读取 Firebase 时出错:从 firebase 值到 child - Error in reading the Firebase: from firebase value to child Flutter Firebase - Null 检查运算符用于 null 值上的字段 - Flutter Firebase - Null check operator used on a null value, can't get Field 参数类型 'List<dynamic> ' 不能分配给参数类型 'String?'。 在 firebase 文档中</dynamic> - The argument type 'List<dynamic>' can't be assigned to the parameter type 'String?'. In firebase document 错误:[dart] 无法将参数类型“Context”分配给参数类型“BuildContext”。 [argument_type_not_assignable] - error: [dart] The argument type 'Context' can't be assigned to the parameter type 'BuildContext'. [argument_type_not_assignable] Heroku 未找到模块:错误:无法解析“-/firebase-config” - Heroku Module not found: Error: Can't resolve '-/firebase-config'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM