objectbox-java
objectbox-java copied to clipboard
Caused by: java.lang.IllegalStateException: No DB catalog present
Code:
val file = File(SDCardUtils.getSDCardPathByEnvironment() + "/CustomFile/dbFile")
if (!file.exists()) {
file.exists()
}
MyObjectBox.builder()
.androidContext(context.applicationContext)
.directory(file)
.build()
Error:
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3909)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4062)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2415)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8401)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Caused by: java.lang.IllegalStateException: No DB catalog present
at io.objectbox.BoxStore.nativeCreateWithFlatOptions(Native Method)
at io.objectbox.BoxStore.(BoxStore.java:271)
at io.objectbox.BoxStoreBuilder.build(BoxStoreBuilder.java:591)
机型:xiaomi 手机
Thanks for reporting! To help us diagnose this issue, please answer some questions. How often does this occur? Does this only occur on that device model? What version of ObjectBox is used? What version of Android is used?
See the comment in #865 for potential solutions. As the file is on an SD card this might be a case of file corruption.
crash:100% current only xiaomi device objectbox.gradle version:3.7.1 io.objectbox:objectbox-kotlin:3.7.1 Android13
@whatshappen Thanks! Does the app use multiple processes by any chance?
@whatshappen Thanks! Does the app use multiple processes by any chance?
no,init crash, is main thread