Release app can not open connection to DB


#1

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


#2

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


#3

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": [
    "cordova-plugin-whitelist",
    "cordova-plugin-console",
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],

#4

Yeah but what are the exact commands you used?


#5

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.


#6

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


#7

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


#8

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


#9

No, I do check if the platform is ready.

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