我对自己也是无语了,逗笑我了。
灵感来源于这篇博文
我擅自主张改变了实体表的名
@Entity(tableName = "tb_crime")
data class Crime(
@PrimaryKey val id: UUID,
val title: String,
val date: Date,
val isSolved: Boolean
)
书上的代码是这个样子的
@Entity
data class Crime(
@PrimaryKey val id: UUID,
val title: String,
val date: Date,
val isSolved: Boolean
)
就因为一个表名我在导入预数据时候一直报错
java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number. Expected identity hash: 74458567a7d4779fbce50002418f2039, found: 81f2ccd0cbc88ef0696bcce4b5d5c0e9
改了表名为默认名之后就欧克了