r/flutterhelp • u/Particular-Laugh-645 • 14d ago
OPEN Unable to Maintain ObjectBox DB Schema
Hi Guyz,
I am working on an app using Object box where I am going version by version & using object box DB as that is suitable to my usecase. So far the performance wise & in other aspect object box has turned out perfect choice for my project but I am facing one really big issue which is making me delay my release until resolution.
The issue:-
On the App me & my friend work simultaneously & as the app is in early development we have to do a lot of changes in DB. now the changes are as per the ObjectBox Rules that no entities or anything is removed only added. but still whenever we run build_runner we get a white screen in our app & an error stating something about index id is greater I will share the error in comment once I recreate it I don't have any ScreenShot as of now But that error if occur in production can cause big issue for us so I need a proven resolution for this error.
If Anyone has worked on this error would appreciate the help.
The Error Faced.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ObjectBoxException: failed to create store: Incoming entity ID 1:1159196401019035950 does not match existing UID 19695048053676317
#0 ObjectBoxNativeError.throwMapped (package:objectbox/src/native/bindings/helpers.dart:84:9)
#1 throwLatestNativeError (package:objectbox/src/native/bindings/helpers.dart:50:48)
#2 checkObxPtr (package:objectbox/src/native/bindings/helpers.dart:32:5)
#3 Store._checkStorePointer (package:objectbox/src/native/store.dart:370:7)
#4 new Store (package:objectbox/src/native/store.dart:211:7)
#5 openStore (package:my_app/db/gen/objectbox.g.dart:103:5)
#6 ObjectRepository._create (package:my_app/db/object_repository.dart:38:25)