sqlite3_open_v2(“/ data / data / com.android.packagename / databases / dump.sqlite”,&handle,1,NULL)失败

前端之家收集整理的这篇文章主要介绍了sqlite3_open_v2(“/ data / data / com.android.packagename / databases / dump.sqlite”,&handle,1,NULL)失败前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用sqlite数据库….应用程序工作在2.3及更高版本…当我试图在2.2中运行…我得到一个像…的错误
E/Database(2476):sqlite3_open_v2("/data/data/com.android.packagename/databases/dump.sqlite",&handle,1,NULL) Failed

数据库有一些问题.

当我试图在2.2中运行我的应用程序时.
我的logcat显示

E/Database(2476):sqlite3_open_v2("/data/data/com.android.canadaQbank/databases/dump.sqlite",NULL) Failed
D/asset(2476): Data exceeds UNCOMPRESS_DATA_MAX (4594688 vs 1048576)
D/AndroidRuntime(2476): Shutting down VM
W/dalvikvm(2476): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
D/dalvikvm(2476): GC_FOR_MALLOC freed 6256 objects / 356848 bytes in 165ms
E/AndroidRuntime(2476): FATAL EXCEPTION: main
E/AndroidRuntime(2476): java.lang.Error: Error copying database
E/AndroidRuntime(2476):     at com.android.canadaQbank.DBAdapter.createDataBase(DBAdapter.java:83)
E/AndroidRuntime(2476):     at com.android.canadaQbank.Select.getUsers(Select.java:110)
E/AndroidRuntime(2476):     at com.android.canadaQbank.Select.onCreate(Select.java:92)
E/AndroidRuntime(2476):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(2476):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(2476):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(2476):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime(2476):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(2476):     at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(2476):     at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(2476):     at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(2476):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(2476):     at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(2476):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(2476):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(2476):     at dalvik.system.NativeStart.main(Native Method)

请有人帮忙……

我也有同样的问题sqlite3_open_v2失败了

但在搜索到这个问题后,我发现这个link并且我根据此链接修改了我的代码,修改后的代码如下所示:

public boolean databaseExist()
{
    File dbFile = new File(DB_PATH + DB_NAME);
    return dbFile.exists();
}

希望这也有助于解决您的问题.

猜你在找的Sqlite相关文章