Firebase , classmaper : no setter/field found for 'UserTwo' on class 'myclass'

前端 未结 1 1448
梦毁少年i
梦毁少年i 2021-01-22 10:43

So firebase keeps giving me nullpointer exception , and also that it can\'t find any setter/field on class \'ChatModel\' , here is my chatModel class :

package e         


        
相关标签:
1条回答
  • 2021-01-22 11:08

    The POJO class does not have the same structure with the database.

    Change your ChatModel class fields to

    public class ChatModel {
        public Map<String,Object> Messages = new HashMap<>();
        public String UserOne;
        public String UserTwo;
    
        // constructor
        // setter and getter
    }
    
    0 讨论(0)
提交回复
热议问题