Firebase Database Error - Expected a Map while deserializing, but got a class java.util.ArrayList

后端 未结 2 623
灰色年华
灰色年华 2021-01-23 06:26

Edit: Figured it out, check my posted answer if you\'re having similar issues.

I know there are several questions about this issue, but none of their s

2条回答
  •  半阙折子戏
    2021-01-23 07:01

    The main issue is that you are using a List instead of a Map. As your error said, while deserializing it is expectig a Map but is found an ArrayList.

    So in order to solve this problem youd need to change all the lists in your model with maps like this:

    private Map mMapOne;
    

    After changing all those fileds like this, you need also to change your public setters and getters.

    Hope it helps.

提交回复
热议问题