SQLite突然认为一切都不是错误

时间:2015-04-07 14:08:58

标签: android sqlite activeandroid

它开始于一个Android手机,简单的创建语句在 assets / migrations 文件夹内的文件中(我使用名为ActiveAndroid的第三方库,并且2年它工作正常 - 我没有改变关于那个的任何事情):

CREATE TABLE IF NOT EXISTS Car (Brand TEXT);

我得到了这个例外:

04-07 15:31:36.683  15738-15738/? E/SQLiteLog﹕ (21) API called with NULL prepared statement
04-07 15:31:36.683  15738-15738/? E/SQLiteLog﹕ (21) misuse at line 63243 of [00bb9c9ce4]
java.lang.RuntimeException: Unable to create application com.activeandroid.app.Application: android.database.sqlite.SQLiteException: not an error (code 0)


at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.database.sqlite.SQLiteException: not an error (code 0)
            at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
            at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:727)
            at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
            at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
            at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1665)
            at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1594)
            at com.activeandroid.DatabaseHelper.executeSqlScript(DatabaseHelper.java:185)
            at com.activeandroid.DatabaseHelper.executeMigrations(DatabaseHelper.java:155)
            at com.activeandroid.DatabaseHelper.onUpgrade(DatabaseHelper.java:78)
            at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:257)
            at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
            at com.activeandroid.Cache.openDatabase(Cache.java:104)
            at com.activeandroid.Cache.initialize(Cache.java:77)
            at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:43)
            at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:30)
            at com.activeandroid.app.Application.onCreate(Application.java:25)
            at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
            at android.app.ActivityThread.access$1300(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)

所以我在我的计算机上用一个名为SQLite Manager的Firefox插件检查了它并创建了一个全新的文件(该文件与Android数据库完全无关)。 我使用了这个选择,并在最后一个错误中得到了这个:

enter image description here

似乎每个SQLite语句都是而不是错误语句。

不幸的是,Android无法解决这个问题。

我该怎么办?

1 个答案:

答案 0 :(得分:20)

资产\迁移文件夹中的升级脚本似乎有一些空行,导致不是错误