DatabaseException: Found two getters or fields with conflicting case sensitivity

前端 未结 3 433
耶瑟儿~
耶瑟儿~ 2020-12-06 07:26

Every time I try to retrieve data from my database, I get

com.google.firebase.database.DatabaseException: Found two getters or fields with conflicting case s         


        
3条回答
  •  悲&欢浪女
    2020-12-06 07:57

    The Firebase Database consider these items when serializing/deserializing JSON:

    • public fields
    • JavaBean-like property getters/setters

    Since you have both a public field N and getN()/setN() methods, it considers the two in conflict. While in this case setting N and calling setN() leads to the same result, that may not always be the case. The chance of getting it wrong is too big, which is why the scenario is simply not allowed.

    The error message is a bit of a red herring in this case. We should improve that.

提交回复
热议问题