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

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

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

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


        
7条回答
  •  忘掉有多难
    2021-01-07 20:47

    Add @IgnoreExtraProperties to your class

    @IgnoreExtraProperties
    public class YourPojo {
        public String name;
    
        // Default constructor for Firebase
        public YourPojo(){} 
    
        // Normal constructor
        public YourPojo(String name) {
            this.name = name;   
        }
    }
    

提交回复
热议问题