Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sqlite 打开数据库时出错,Cordova Web浏览器_Sqlite_Cordova_Ionic Framework_Ionic2 - Fatal编程技术网

Sqlite 打开数据库时出错,Cordova Web浏览器

Sqlite 打开数据库时出错,Cordova Web浏览器,sqlite,cordova,ionic-framework,ionic2,Sqlite,Cordova,Ionic Framework,Ionic2,我正在为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: exe

我正在为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
opendatabase:details.db
错误:找不到::SQLitePlugin::close的exec代理
错误:找不到::SQLitePlugin::open的exec代理
打开数据库:details.db失败,中止任何挂起的事务
错误:无法打开数据库
在newSQLError(SQLitePlugin.js:25)
在SQLitePlugin.js:198
在Object.module.exports[as exec](cordova.js:1006)
在SQLitePlugin.js:207
在Object.module.exports[as exec](cordova.js:1006)
在SQLitePlugin.open(SQLitePlugin.js:210)
在新的SQLitePlugin(SQLitePlugin.js:84)
反对。(SQLitePlugin.js:600)
在Object.openDatabase(SQLitePlugin.js:58)
索引:js:176
我已经通过爱奥尼亚Cordova平台添加浏览器添加了Cordova功能

我运行liko应用程序,因此:

爱奥尼亚cordova跑步浏览器


这是否意味着此cordova功能(创建数据库)在浏览器中不可用?

似乎您必须使用模拟才能将浏览器环境与SQlite一起使用。我也会试试这个:

有些人对此提出了警告,因此我建议采用另一种方法:

您无法通过Cordova Web浏览器打开数据库。 您可以使用VisualStudio提供的


这样就可以访问数据库。

浏览器不是移动设备。例如,当需要根据插件进行测试时,我倾向于检查我们是在真实设备中还是在浏览器上运行。在浏览器上最接近sql的是websql,但它已被弃用: