# Why SQLite plugin at certain point goes in error?

**URL:** <https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210>\
**Category:** ionic-v3\
**Created:** [March 28, 2018, 1:14pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210 "2018-03-28T13:14:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjord](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@gjord](https://forum.ionicframework.com/u/gjord)\
**Post date:** [March 28, 2018, 1:14pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210/1 "2018-03-28T13:14:49Z")

</div>

I have my app built in ionic 3 and I installed the plugin in this way (following the official doc):

1. ionic cordova plugin add cordova-sqlite-storage
2. 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?

- console.warn: Native: tried accessing the SQLite plugin but it’s not installed

- console.warn: Install the SQLite plugin: 'ionic cordova plugin add cordova-sqlite-storage

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!

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [March 28, 2018, 2:02pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210/2 "2018-03-28T14:02:58Z")

</div>

Where and how are you testing your app?  
What is your `ionic info` output?  
Are you interactions with the plugin wrapped in `platform.ready()`?

---

<div class="post-metadata">

**Author:** ![gjord](https://avatars.discourse-cdn.com/v4/letter/g/85f322/32.png) [@gjord](https://forum.ionicframework.com/u/gjord)\
**Post date:** [March 28, 2018, 2:11pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210/3 "2018-03-28T14:11:48Z")

</div>

ionic info outputs:

```auto
C:\project\ionic\photoShoot>ionic info

cli packages: (C:\Users\fabio\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms : android 7.0.0 browser 5.0.3
    Ionic Framework : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node : v8.9.1
    npm : 5.6.0
    OS : Windows 8.1

Environment Variables:

    ANDROID_HOME : C:\Users\fabio\AppData\Local\Android\android-sdk

Misc:

    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?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [March 28, 2018, 2:29pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210/4 "2018-03-28T14:29:52Z")

</div>

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](https://ionic.zone/cordova/update)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:42pm UTC](https://forum.ionicframework.com/t/why-sqlite-plugin-at-certain-point-goes-in-error/126210/5 "2021-07-19T21:42:41Z")

</div>

Closed on July 19, 2021, 9:42pm UTC


