我创建了一个phonegap应用,它在Android 4.3及更低版本上运行良好。在4.4上它点击任何链接时抛出错误:
net :: ERR_FILE_NOT_FOUND(file:/// loginPage)
在后端看到的错误是:
> 12-18 17:04:36.214: V/info(17666): Open sqlite db: > /data/data/com.sample.sampleapp/databases/sample_db.db 12-18 > 17:04:36.214: E/SQLiteLog(17666): (14) cannot open file at line 30191 > of [00bb9c9ce4] 12-18 17:04:36.214: E/SQLiteLog(17666): (14) > os_unix.c:30191: (2) > open(/data/data/com.sample.sampleapp/databases/sample_db.db) - > 12-18 17:04:36.214: D/CordovaLog(17666): > file:///android_asset/www/js/phonegap_interface.js: Line 55 : Going to > initialize database if required 12-18 17:04:36.214: I/chromium(17666): > [INFO:CONSOLE(55)] "Going to initialize database if required", source: > file:///android_asset/www/js/phonegap_interface.js (55) 12-18 > 17:04:36.214: D/CordovaLog(17666): > file:///android_asset/www/js/phonegap_interface.js: Line 66 : Going to > open database sample_db 12-18 17:04:36.214: I/chromium(17666): > [INFO:CONSOLE(66)] "Going to open database sample_db", source: > file:///android_asset/www/js/phonegap_interface.js (66) 12-18 > 17:04:36.214: D/CordovaLog(17666): > file:///android_asset/www/js/SQLitePlugin.js: Line 8 : SQLitePlugin > openargs: {"name":"sample_db"} 12-18 17:04:36.214: I/chromium(17666): > [INFO:CONSOLE(8)] "SQLitePlugin openargs: {"name":"sample_db"}", > source: file:///android_asset/www/js/SQLitePlugin.js (8) 12-18 > 17:04:36.214: E/SQLiteDatabase(17666): Failed to open database > '/data/data/com.sample.sampleapp/databases/sample_db.db'. 12-18 > 17:04:36.214: E/SQLiteDatabase(17666): > android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error > (code 14): Could not open database
答案 0 :(得分:0)
所以这对我使用Cordova-SQLitePlugin的其中一个插件来说是一个问题。 基本上,如果数据库目录不存在,则必须创建它。现在已经修好了。