【发布时间】:2018-06-30 06:11:21
【问题描述】:
我正在为 ionic 2 中的应用程序创建数据库,但在我创建它的位置失败:
this.sqlite.create({
name: 'details.db',
location: 'default'
}).then((db: SQLiteObject) => {
//... }
错误:
OPEN database: details.db
Error: exec proxy not found for :: SQLitePlugin :: close
Error: exec proxy not found for :: SQLitePlugin :: open
OPEN database: details.db FAILED, aborting any pending transactions
Error: Could not open database
at newSQLError (SQLitePlugin.js:25)
at SQLitePlugin.js:198
at Object.module.exports [as exec] (cordova.js:1006)
at SQLitePlugin.js:207
at Object.module.exports [as exec] (cordova.js:1006)
at SQLitePlugin.open (SQLitePlugin.js:210)
at new SQLitePlugin (SQLitePlugin.js:84)
at Object.<anonymous> (SQLitePlugin.js:600)
at Object.openDatabase (SQLitePlugin.js:58)
at index.js:176
我已通过ionic cordova platform add browser 添加了 Cordova 功能。
我这样运行应用程序:
ionic cordova run browser
是否意味着浏览器中没有此cordova功能(创建数据库)?
【问题讨论】:
-
浏览器不是移动设备。例如,当需要根据插件进行测试时,我倾向于检查我们是在真实设备中还是在浏览器上运行。您在浏览器上将拥有的最接近 sql 的东西是 websql,但它已被弃用:caniuse.com/#feat=sql-storage
标签: sqlite cordova ionic-framework ionic2