【发布时间】:2020-09-24 03:15:48
【问题描述】:
错误:in realm, io.realm.RealmObjectSchema.checkFieldExists: Field name doesn't exist on object "ModelName": "oldField"
在 renameField 之后,我在 firebase 中收到此错误,但不知何故,当我从 android studio 构建和运行时,我的应用程序运行良好,没有问题。我尝试重现此错误。但它没有用。我在代码中没有看到任何问题
这是我在 migration.kt 中的代码:
if (oldVersion == 11L) {
schema.get("ModelName")!!
.renameField("oldField", "newField")
oldVersion++
}
我还增加了迁移模式
【问题讨论】:
标签: java android kotlin migration realm