ошибка:
Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
Моя сущность
@Entity
data class Category(var category: String) {
@field: PrimaryKey(autoGenerate = true)
var categoryId: Int = 0
}
Ошибка объясняет, что не так. Добавьте пустой конструктор (например: public Dog(){})
Согласно сообщению об ошибке, вам необходимо добавить конструктор для этого класса.
@Entity data class Category(var category: String) {
@field: PrimaryKey(autoGenerate = true) var categoryId: Int = 0
constructor() : this(0)
}
опубликуйте свой класс модели для справки.