silverr
silverr

Reputation: 103

react-native firebase No properties to serialize found on class com.facebook.react.bridge.ReadableNativeMap

Eversince I switched from the firebase web SDK to react-native-firebase, I cannot create a usernode on the database after registering the user. I get the following error(on windows):

https://i.sstatic.net/0ECFX.png

On a Mac, I ran and Android, the app didn't crash, but it did not set the node on the databse. However, it works on iOS.

Taken from package.json:

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

In my android build.gradle i have:

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.

the rest of the messege. No error shown in debugger.

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

And the action that previously worked:

//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
        })
      );
  };
};

I've tried many other ways to make it work, but none did. I also haven't found anything on google that was specifically react-native. Any ideas?

Upvotes: 3

Views: 358

Answers (1)

Bruno Lemos
Bruno Lemos

Reputation: 9253

This is a bug on [email protected].

Upgrade to [email protected] or newer to fix this issue.

Upvotes: 2

Related Questions