Cordova-sqlite-storage: Database location or iosDatabaseLocation issue

Created on 5 Apr 2016  路  8Comments  路  Source: storesafe/cordova-sqlite-storage

Hi,
I recently got the updated version of sqlite plugin, which is 0.8.5, now I am getting error trying to run the APK.
ionic info of my machine:

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 7 SP1
Node Version: v4.3.1

SQLite plugin version

cordova-sqlite-storage 0.8.5 "Cordova sqlite storage plugin (core version)"

Error I am getting:
Uncaught Error: Database location or iosDatabaseLocation value is now mandatory in openDatabase call
This is how I open a database :
$cordovaSQLite.openDB('ca.app.db')

Is the recent change not backward compatible?

question

All 8 comments

It is already documented as a breaking change. The old default value was wrong. I would rather break existing code than risk an upgrade problem for existing apps.

You have to define a database location, as documented.

Hi,
I am new with Ionic, and I'm having the same error. How can I correct?

Error:
1 239274 error Uncaught Error: Database location or iosDatabaseLocation value is now mandatory in openDatabase call, http://192.168.1.108:8100/plugins/cordova-sqlite-storage/www/SQLitePlugin.js, Line: 563

On May 17, 2016 7:44 PM, "GiovaniSantos93" [email protected] wrote:

Hi,
I am new with Ionic, and I'm having the same error. How can I correct?

Error:
1 239274 error Uncaught Error: Database location or iosDatabaseLocation
value is now mandatory in openDatabase call,
http://192.168.1.108:8100/plugins/cordova-sqlite-storage/www/SQLitePlugin.js,
Line: 563

This is already documented. You must specify either a location option or
iosLocation option when you open a database, as documented in README.md.

Hello,

Please cech my blog to view solution of this error.
Error: Database location or iosDatabaseLocation value is now mandatory in openDatabase call

http://phonegapcmsworld.blogspot.in/2016/06/iosDatabaseLocation-value-is-now-mandatory-in-openDatabase-call.html

Thanks,

Please cech my blog to view solution of this error.
Error: Database location or iosDatabaseLocation value is now mandatory in openDatabase call

http://phonegapcmsworld.blogspot.in/2016/06/iosDatabaseLocation-value-is-now-mandatory-in-openDatabase-call.html

If you state that something works on Android but not iOS, please first analyze _why_ you make this observation. If you really see such a case, please report an issue along with reproduction code.

I find it strange that the code in this article uses the "createFromLocation" (pre-populated database) option in case of iOS but not Android.

The recommended approach is to simply use location: 'default' regardless of Android/iOS/Windows in new applications.

location: 'default' is, in android, the equivalent of cordova.file.dataDirectory ?
If not, which is default folder in a android device?

cordova.file.dataDirectory is not default location?

Was this page helpful?
0 / 5 - 0 ratings