com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please use Lists instead

前端 未结 7 536
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-07 19:57

I am trying to persist a custom object using the following code:

DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();
Databas         


        
7条回答
  •  -上瘾入骨i
    2021-01-07 20:35

    In case this helps others that are receiving the same error, I was getting the same error and the solution ended up being the following for me:

    Changing:

    databaseReference.child("somechild").setValue(etName.getText());
    

    To:

    databaseReference.child("somechild").setValue(etName.getText().toString());
    

    As @fraggjkee points out, Firebase attempts to serialize getters, and this was the similar issue here with firebase attempting to serialize the result of the .getText().

    Hope this helps others!

提交回复
热议问题