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

Viewed 3423

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 solutions are working for me.

In my model class I have made sure to use List instead of Arraylist to avoid Firebase issues, but am still getting this error. It's a lot of code but most questions ask for all the code so I'll post it all.

TemplateModelClass.java

//

I've used this basic model successfully many times. For the

HashMaps<String, List<String>>,

the String is an incremented Integer converted to String. The List's are just Strings in a List. Here's some sample JSON from Firebase:

 //

Formatted that as best as I could. If you need a picture of it let me know and I'll get a screenshot

And am getting this error, as stated in the title:

com.google.firebase.database.DatabaseException: Expected a Map while deserializing, but got a class java.util.ArrayList

The most upvoted question about this seems to have something to do with a problem using an integer as a key, but I think I've avoided that by always using an integer converted to a string. It may be interpreting it strangely, so I'll try some more stuff in the meantime. Thanks for reading!

2 Answers
Related