【发布时间】:2018-12-12 20:16:20
【问题描述】:
错误:
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(){})
标签: android mvvm android-room