DbException for mismatching UID
See original GitHub issueI added ObjectBox to our project and pushed to master. Another contributor added his code and merged it with master. I pulled it again and run now into the following problem (he did not changed code on ObjectBox):
java.lang.RuntimeException: Unable to create application no.ntnu.tdt4240.geoquiz9000.App: io.objectbox.exception.DbException: Incoming entity ID 1:2501900967712254997 does not match existing UID 4549294657536897732 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4731) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) Caused by: io.objectbox.exception.DbException: Incoming entity ID 1:2501900967712254997 does not match existing UID 4549294657536897732 at io.objectbox.BoxStore.nativeCreate(Native Method) at io.objectbox.BoxStore.<init>(BoxStore.java:201) at io.objectbox.BoxStoreBuilder.build(BoxStoreBuilder.java:157) at no.ntnu.tdt4240.geoquiz9000.App.onCreate(App.java:16) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
@greenrobot : thanks for the nuke instructions. I did that several times to no avail.
Then I remembered that
android:allowBackup="true"
's favorite job is to restore a buggy database file before the first start even after an uninstall. Set tofalse
during development!What about an option that is deleting and creating an new file if such a exception is happening.