Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caused by: java.lang.IllegalStateException: No DB catalog present #1169

Open
whatshappen opened this issue Jan 18, 2024 · 5 comments
Open

Caused by: java.lang.IllegalStateException: No DB catalog present #1169

whatshappen opened this issue Jan 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@whatshappen
Copy link

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)

@whatshappen whatshappen added the bug Something isn't working label Jan 18, 2024
@whatshappen
Copy link
Author

机型:xiaomi 手机

@greenrobot-team
Copy link
Member

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.

@whatshappen
Copy link
Author

crash:100%
current only xiaomi device
objectbox.gradle version:3.7.1
io.objectbox:objectbox-kotlin:3.7.1
Android13

@greenrobot-team
Copy link
Member

@whatshappen Thanks! Does the app use multiple processes by any chance?

@github-actions github-actions bot removed the more info required Further information is requested label Jan 24, 2024
@whatshappen
Copy link
Author

@whatshappen Thanks! Does the app use multiple processes by any chance?

no,init crash, is main thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants