-2

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Tariro
  • 1

1 Answers1

1

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.
Bruno Kinast
  • 1,068
  • 4
  • 17