I'm trying to get all the documents from firebase and convert them directly into an object but I jump with the following error:
java.lang.RuntimeException: Could not deserialize object. Class com.chdzma.changeproject.objects.Food does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped
And this is the class:
class Food(name:String, description: String, calories: Int, carbo: Int, fats: Int, proteins: Int, sodium: Int, sugar: Int) : Item{
val name = name
val description = description
val calories = calories
val carbo = carbo
val fats = fats
val proteins = proteins
val sodium = sodium
val sugar = sugar
override fun getViewType(): Int {
return 1
}
}