【发布时间】:2016-03-01 16:10:47
【问题描述】:
我正在使用我的 cordova android 项目运行 cordova sqlite-ext 插件 (https://github.com/litehelpers/cordova-sqlite-ext),并尝试打开一个预先存在的 sqlite .db。我一直看到下面的错误,说它正在打开我的数据库但没有找到表。
我决定将数据库完全重命名为“wibblewobble”,看看它是否会产生未知错误,因为 wibblewobble 不存在,但我仍然得到相同的结果。
任何使用 sqlite 插件的人都可以解释为什么这会出现在我的 logcat 中而我的内容没有出现?为什么我收到虚假错误说数据库正在打开,而它显然不是?
03-01 10:59:22.210 850-911/cafr.b.appfinder W/PluginManager: THREAD WARNING: exec() call to SQLitePlugin.open blocked the main thread for 71ms. Plugin should use CordovaInterface.getThreadPool().
03-01 10:59:22.510 850-850/cafr.b.appfinder I/chromium: [INFO:CONSOLE(106)] "new transaction is waiting for open operation", source: file:///android_asset/www/plugins/cordova-sqlite-ext/www/SQLitePlugin.js (106)
03-01 10:59:23.780 850-850/cafr.b.appfinder I/chromium: [INFO:CONSOLE(80)] "DB opened: wibblewobble.db", source: file:///android_asset/www/plugins/cordova-sqlite-ext/www/SQLitePlugin.js (80)
03-01 10:59:24.240 850-911/cafr.b.appfinder W/PluginManager: THREAD WARNING: exec() call to SQLitePlugin.backgroundExecuteSqlBatch blocked the main thread for 64ms. Plugin should use CordovaInterface.getThreadPool().
03-01 10:59:25.880 850-903/cafr.b.appfinder E/SQLiteLog: (1) no such table: MainDatabase
03-01 10:59:25.890 850-903/cafr.b.appfinder W/System.err: android.database.sqlite.SQLiteException: no such table: MainDatabase (code 1): , while compiling: SELECT DISTINCT Category FROM `MainDatabase`
03-01 10:59:25.890 850-903/cafr.b.appfinder W/System.err: at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
【问题讨论】: