我想刪除其中一個存儲的realm物件。但我不斷收到錯誤。刪除存儲的實物之一android
val realm = Realm.getInstance(this)
val allUsers = realm.where(User::class.java).findAll()
val deletedDependent = realm.where(User::class.java).equalTo("id",deleteDependentData.dependentUUID).findFirst()
try {
realm.beginTransaction()
deletedDependent.removeFromRealm()
realm.commitTransaction()
} catch (e: RealmException) {
info("Error deleting realm object=>${e.message}")
e.printStackTrace()
}
日誌說,Could not find class 'io.realm.rx.RealmObservableFactory$1', referenced from method io.realm.rx.RealmObservableFactory.from
如果我用removeLast,它抱怨是不支持刪除。有人可以幫我解決這個問題嗎?
如果您不使用Rx,則不必添加RxAndroid,您只需創建一個虛擬對象,如下所示:https://realm.io/docs/java/latest/#jackson-databind – EpicPandaForce