随机异常android.database.sqlite.SQLiteException:无法打开数据库文件 [英] Random exception android.database.sqlite.SQLiteException: unable to open database file
问题描述
我的应用程序使用发送堆栈跟踪给我的应用程序崩溃时,未捕获的异常处理程序。我经常得到随机的用户此报告。
我不能复制它,数据库的开放总会成功在我的情况。这不是存储在外接SD卡的数据库,只有打开 SQLiteOpenHelper数据库(背景下,SomeName,空,someVersion code)
。
你有任何这方面的经验吗?什么是我能打开数据库前检查准备?
感谢您!
android.database.sqlite.SQLiteException:无法打开数据库文件
在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
在android.app.ActivityThread.access $ 2200(ActivityThread.java:119)
在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1863)
在android.os.Handler.dispatchMessage(Handler.java:99)
在android.os.Looper.loop(Looper.java:123)
在android.app.ActivityThread.main(ActivityThread.java:4363)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:521)
在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:860)
在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
在dalvik.system.NativeStart.main(本机方法)
android.database.sqlite.SQLiteException:产生的原因无法打开数据库文件
在android.database.sqlite.SQLiteDatabase.dbopen(本机方法)
在android.database.sqlite.SQLiteDatabase< INIT>(SQLiteDatabase.java:1698)
在android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)
在android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)
在android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)
在android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)
在android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
在android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
解决方案
我升级我的Android固件后,得到了同样的错误
My app uses a uncaught exception handler that sends the stack trace to me when the app crashes. Often I get this report from random users.
I cannot replicate it, the opening of the database always succeeds in my case. This is not a database stored on external SD card, only a database opened with SQLiteOpenHelper(context, "SomeName", null, someVersionCode)
.
Do you have any experience with this? What are the possibilities that I can check before opening the database?
Thank you!
android.database.sqlite.SQLiteException: unable to open database file
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
at android.app.ActivityThread.access$2200(ActivityThread.java:119)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: unable to open database file
at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)
at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1698)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:739)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:761)
at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:754)
at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:476)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
i got the same error after upgrading my android firmware. the database was created by the old firmware and therefore couldn't be opened by the new firmware. users could solve this error by uninstall and reinstall your app.
这篇关于随机异常android.database.sqlite.SQLiteException:无法打开数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!