[Solved] android firebase unable to instantiate abstract class when call getValue() in listener


Your concrete Outfit class has fields and properties that define Item:

public class Outfit implements Parcelable{
    private List<Item> itemList = new ArrayList<>();

    ...    
    public List<Item> getItemList() 

This means that the Firebase SDK will try to instantiate an Item, which isn’t possible due to it being abstract. Most likely you want Firebase to instantiate the right (concrete) subtype of Item when it’s reading the data, but it has no way to know what subtype that is.

You will either have to mark Item as non-abstract, or you will have to mark the itemList as having a specific concrete subtype of Item.

1

solved android firebase unable to instantiate abstract class when call getValue() in listener