MyObjectBox is a generated class, so make sure the project builds successfully. Resolve any other build errors.
Check that the project is configured correctly. E.g. for Kotlin, check that the kapt plugin is applied (
apply plugin: 'kotlin-kapt') before the ObjectBox plugin.
android-apt is known to cause problems, try to remove it.
If your team makes concurrent modifications to the data model (e.g. adding/removing entities or properties) it may clash with your changes. Read the meta model docs on how to resolve the conflicts.
You might get an exception like
DbException DB’s last entity ID 4 is higher than 3 from model after switching back from a branch and running your app. This is expected if that branch makes incompatible changes to entities. You need to uninstall or clear all data of your app before running it again.
Here is why: Let’s say you have created a new entity on a new branch and ran your app on a device. This will upgrade the ObjectBox database on that device to support the new entity (ObjectBox keeps track of entity types internally by storing some meta info inside the database). Now, when you return to your previous branch and try to run the app ObjectBox will fail with an error message similar to the one above. This is because the entity types passed by your code no longer match those stored inside the database. In other words, the database can not be downgraded to the previous version. Thus, it is advised to clear the database before running your app after switching branches. Check the meta model docs for more details.
This can have various reasons. In general check your ABI filter setup or add one in your Gradle build file.
If your app explicitly ships code for "armeabi": For Android, ObjectBox comes with binaries for “armeabi-v7a” and “arm64-v8a” ABIs. We consider “armeabi” to be outdated and thus do not support it. Check if you have a Gradle config like abiFilters "armeabi", which is causing the problem (e.g. remove it or change it to “armeabi-v7a”).
If your app uses split APKs or App Bundle: some users might have sideloaded your APK that includes the library for a platform that is incompatible with the one of their device. See App Bundle, split APKs and Multidex for workarounds.
If you are doing Android instrumentation (especially with Espresso), you may get a warning like this:
Error:Conflict with dependency ‘com.google.code.findbugs:jsr305’ in project ‘:app’. Resolved versions for app (3.0.2) and test app (2.0.1) differ. See
You can easily resolve the version conflict by adding this Gradle dependency:
Check the data model migration guide if you get an exception like:
io.objectbox.exception.DbException: Property […] is not compatible to its previous definition. Check its type.
Cannot change the following flags for Property
Sometimes you might get an error code along with a error message. Typically, you will find error codes in parenthesis. Example:
Could not prepare directory: objectbox (30)
This error code comes from the OS, and gives you additional information; e.g. 30 tells that you tried to init a database in a read-only location of the file system, which cannot work.
Here's the list of typical OS errors:
Operation not permitted
No such file or directory
No such process
Interrupted system call
No such device or address
Argument list too long
Exec format error
Bad file number
No child processes
Out of memory
Block device required
Device or resource busy
No such device
Not a directory
Is a directory
File table overflow
Too many open files
Not a typewriter
Text file busy
File too large
No space left on device
Read-only file system
Too many links
Math argument out of domain of func
Math result not representable
If you believe to have found a bug or missing feature, please create an issue. https://github.com/objectbox/objectbox-java/issues
If you have a usage question regarding ObjectBox, please post on Stack Overflow. https://stackoverflow.com/questions/tagged/objectbox