I have my app built in ionic 3 and I installed the plugin in this way (following the official doc):
- ionic cordova plugin add cordova-sqlite-storage
- npm install --save @ionic-native/sqlite
I don’t know why, at a certain point, suddenly, I got the following warn, and I need to re-execute the 2 command above . Why?
Then if I re-launch the 2 commands (point 1 and 2 above), all is ok, but after various launch of my app, the problem will be present again.
Thanks help me!
Where and how are you testing your app?
What is your
ionic info output?
Are you interactions with the plugin wrapped in
ionic info outputs:
cli packages: (C:\Users\fabio\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
cordova (Cordova CLI) : 8.0.0
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 7.0.0 browser 5.0.3
Ionic Framework : ionic-angular 3.9.2
Android SDK Tools : 26.1.1
Node : v8.9.1
npm : 5.6.0
OS : Windows 8.1
ANDROID_HOME : C:\Users\fabio\AppData\Local\Android\android-sdk
backend : pro
In my constructor I initialize the data storage. Then I call initializeApp method that checks
this.platform.ready().then(() => …
You are saying to move the data storage init inside the check of the platform ready?
Any code that interacts with native functionality (like all Ionic Native wrappers that use Cordova plugins) only works if the platform is loaded and ready. Checking for
platform.ready() is one way to make sure this is the case.
Also (but probably not the cause for your problem):
Your Cordova tooling seems to be out of date, which might be causing all kinds of problems.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update