May someone please assist me with this error?

61 views Asked by At

I am trying to create a basic todo app in flutter using Objectbox as a database.

This is the error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]
Unhandled Exception: ObjectBoxException: failed to create store:
Incoming entity ID 1:2836062220106497081 does not match existing UID 524091579686138896

1

There are 1 answers

0
Bruno Kinast On

From the ObjectBox's troubleshooting guide:

This means there is a conflict between the data model defined in your code (using @Entity classes) and the data model of the existing database file.

In the meta models docs it says:

There are basically two ways to resolve this:

  • Resolve conflicts in or reconstruct the default.json meta model file to match the model of an existing database file.
  • Keep or create a fresh default.json model file and delete the database file. However, this will lose all existing data.