gpt4 book ai didi

javascript - react-native firebase 在类 com.facebook.react.bridge.ReadableNativeMap 上找不到要序列化的属性

转载 作者:行者123 更新时间:2023-11-29 10:59:21 25 4
gpt4 key购买 nike

自从我从 firebase web SDK 切换到 react-native-firebase 后,我无法在注册用户后在数据库上创建用户节点。我收到以下错误(在 Windows 上):

https://i.imgur.com/sddZEeY.png

我在 Mac 和 Android 上运行,应用程序没有崩溃,但它没有在数据库上设置节点。但是,它适用于 iOS。

取自 package.json:

   "react-native": "0.54.2"
"react-native-firebase": "^4.1.0"

在我的 android build.gradle 中我有:

dependecies{
...
implementation "com.google.android.gms:play-services-base:15.0.0"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-auth:15.1.0"
implementation "com.google.firebase:firebase-messaging:15.0.2"
implementation "com.google.firebase:firebase-database:15.0.0"
}

Tested only on android.

消息的其余部分。调试器中没有显示错误。

No properties to serialize found on class com.facebook.react.bridge.ReadableNativeMap
<init>
null
zza
null
zzi
null
zzh
null
zza
null
setValue
null
set
RNFirebaseDatabase.java:332
invoke
Method.java
invoke
JavaMethodWrapper.java:374
invoke
JavaModuleWrapper.java:162
run
NativeRunnable.java
handleCallback
Handler.java:751
dispatchMessage
Handler.java:95
dispatchMessage
MessageQueueThreadHandler.java:31
loop
Looper.java:154
run
MessageQueueThreadImpl.java:194
run
Thread.java:761

以及之前有效的操作:

//register
export const registerUser = (
{
userName, //name of the user
userEmail, //email of the user
password //pw of the user
},
onSuccess, //callback()
onFail // callback(showDialog[bool], { dialogTitle, dialogBody })
) => {
console.log("register user", userEmail, password);
return dispatch => {
firebase
.auth()
.createUserWithEmailAndPassword(userEmail, password)
.then(user => {
console.log("registering user.uid: ", user.uid);
firebase
.database()
.ref(`${DBREF_USERS}${user.uid}`)
.set({
name: userName,
email: userEmail,
id: user.uid
},
dispatch({
type:REGISTER_SUCCESS,
payload: user.uid
}))
onSuccess();
})
.catch(error =>
onFail(true, {
dialogTitle: I18n.t("alert_dialog_title"),
dialogBody: error.message
})
);
};
};

我已经尝试了许多其他方法来让它工作,但没有一个成功。我也没有在谷歌上发现任何特别 react native 的东西。有任何想法吗?

最佳答案

这是 react-native@0.54.2 上的错误。

升级到 react-native@0.54.4 或更新版本以解决此问题。

关于javascript - react-native firebase 在类 com.facebook.react.bridge.ReadableNativeMap 上找不到要序列化的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50360629/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com