Release app can not open connection to DB

Hello Everyone.
Recently, I have developed an app using Ionic 2, the app creates Sqlite DB and feed it using web API. Everything working great through IonicView and unsigned .apk app version. But the release version of the app does NOT able to open a connection to DB, I have checked the whole functions of this version, everything working as in the unsigned version except opening the DB.

Any Ideas. Thanks

How are you building your dev version?
How are you building your release version?
What is your ionic info and content of package.json?

I have used: ionic build and ionic package build, to get unsigned and release version of the app.

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: 1.9.0
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v6.9.2
Xcode version: Xcode 8.3.2 Build version 8E2002

 "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/compiler-cli": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/platform-server": "2.2.1",
    "@ionic/storage": "1.1.7",
    "ionic-angular": "2.0.0-rc.4",
    "ionic-native": "2.2.11",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26"
  "devDependencies": {
    "@ionic/app-scripts": "0.0.47",
    "typescript": "2.0.9"
  "cordovaPlugins": [
  "cordovaPlatforms": [
      "platform": "ios",
      "version": "",
      "locator": "ios"

Yeah but what are the exact commands you used?

My first advice would be to upgrade all the things. ionic-angular, app-scripts, angular itself, ionic-native… Can only get better and shouldn’t cause too many problems.

I did updated everything as you advice, I still have the same issue, any suggestions!!

First step: Post your new ionic info and packages.json.

Any chance you’re attempting to access SQLite before the platform is ready?

No, I do check if the platform is ready.

platform.ready().then(() => {
… my code here…

Hi I have the almost same question.

Ionic storage
Could not open database

1.When running:

Ionic cordova run android --device -l --debug --verbose

2.Got console log:

OPEN database: _ionicstorage
SQLitePlugin.js:106 new transaction is queued, waiting for open operation to finish
SQLitePlugin.js:197 OPEN database: _ionicstorage FAILED, aborting any pending transactions
SQLitePlugin.js:83 Could not open database

3.Good / Bad situation

Good: Ionic serve
Good: Ionic serve --devapp (debug on device)
Bad: release .apk (installed on device)
Bad: Ionic cordova run android --device -l --debug --verbose (debug on device)


“dependencies”: {
@angular/animations”: “^8.1.2”,
@angular/cdk”: “^8.1.1”,
@angular/common”: “^8.1.2”,
@angular/core”: “^8.1.2”,
@angular/forms”: “^8.1.2”,
@angular/http”: “^7.2.2”,
@angular/material”: “^8.1.1”,
@angular/platform-browser”: “^8.1.2”,
@angular/platform-browser-dynamic”: “^8.1.2”,
@angular/router”: “^8.1.2”,
@ionic-native/core”: “^5.0.0”,
@ionic-native/splash-screen”: “^5.0.0”,
@ionic-native/status-bar”: “^5.0.0”,
@ionic/angular”: “^4.7.1”,
@ionic/storage”: “^2.2.0”,
“bootstrap”: “^4.3.1”,
“cordova-android”: “8.0.0”,
“cordova-plugin-sqlite”: “^1.0.3”,
“cordova-plugin-sqlite-2”: “^1.0.6”,
“core-js”: “^2.5.4”,
“rxjs”: “~6.5.1”,
“save-dev”: “^2.0.0”,
“tslib”: “^1.9.0”,
“zone.js”: “~0.9.1”

5.have try

a.Edit: storage.ready().then(
storage.get() // <= where came thr error

b.Add: IonicStorageModule.forRoot({name: ‘__mydb’, driverOrder: [‘indexeddb’, ‘sqlite’, ‘websql’]}

c.Delete one or all cordova-plugin-sqlite package

Any ideas?

=> Solved by change the root options. 2019/07/31

Before NG
IonicStorageModule.forRoot({name: ‘__mydb’, driverOrder: [‘sqlite’, ‘websql’, ‘indexeddb’,]}

After OK
IonicStorageModule.forRoot({name: ‘__mydb’, driverOrder: [‘websql’, ‘indexeddb’, ‘sqlite’,]}

=> USE websql rather than sqlite seems works

This looks suspicious. What happens if you lose one or the other of these?

Actually nothing, but the problem have been solved, refer to my previous answer.