I encountered some errors while attempting to connect my ionic app to a database. I am currently running the app on an android device using Google Chrome DevTools to troubleshoot the issue.
Check out the createDatabase() function and the specific error that was generated.
createDatabase() {
this.plt.ready().then(() => {
if (this.plt.is('cordova')) {
this.sqlite = new SQLite();
this.sqlite.create({
name: 'ocp_database_fuits.db',
location: 'default'
}).then((db: SQLiteObject) => {
this.database = db;
this.createTables();
}).catch(e => {
console.log(e);
});
}
});
}
OPEN database: ocp_database_fuits.db
SQLitePlugin.js:197 OPEN database: ocp_database_fuits.db
FAILED, aborting any pending transactions main.js:686 Error: Could not open database
at newSQLError (SQLitePlugin.js:26) at SQLitePlugin.js:199 at Object.callbackFromNative (cordova.js:290) at <anonymous>:1:9