# SQLite plugin not woking in ios simulator

**URL:** <https://forum.ionicframework.com/t/sqlite-plugin-not-woking-in-ios-simulator/71058>\
**Category:** ionic-v3\
**Created:** [November 22, 2016, 9:18pm UTC](https://forum.ionicframework.com/t/sqlite-plugin-not-woking-in-ios-simulator/71058 "2016-11-22T21:18:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnedvard](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/johnedvard/32/99814_2.png) [@johnedvard](https://forum.ionicframework.com/u/johnedvard)\
**Post date:** [November 22, 2016, 9:18pm UTC](https://forum.ionicframework.com/t/sqlite-plugin-not-woking-in-ios-simulator/71058/1 "2016-11-22T21:18:45Z")

</div>

I have some problems with SQLite in ionic 2. It seems that my simulator cannot open the database because the `sqlitePlugin` is not found.

This is my app.component.ts (Same as a blank project from the todays date of ionic 2, typescript, but added with a simple SQLite database):

```
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import {StatusBar, Splashscreen, SQLite} from 'ionic-native';
import { HomePage } from '../pages/home/home';

@Component({
  template: `<ion-nav [root]="rootPage"></ion-nav>`
})
export class MyApp {
  rootPage = HomePage;

  constructor(platform: Platform) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      let db = new SQLite();
      db.openDatabase({
        name: 'data.db',
        location: 'default' // the location field is required
      }).then(() => {
        db.executeSql('create table danceMoves(name VARCHAR(32))', {}).then(() => {
        }, (err) => {
          console.error('Unable to execute sql: ', err);
        });
      }, (err) => {
        console.error(err.toString());
        console.error('Unable to open database: ', err);
      });
      StatusBar.styleDefault();
      Splashscreen.hide();
    });
  }
}

```

I get an error in my console when I run  
`ionic emulate ios --livereload --consolelogs`

```
[22:10:45] console.log: Angular 2 is running in the development mode. Call enableProdMode() to enable the production 
            mode. 
[22:10:45] console.warn: Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to 
            include cordova.js or run in a device/simulator 
[22:10:45] console.warn: Native: tried calling Splashscreen.hide, but Cordova is not available. Make sure to include 
            cordova.js or run in a device/simulator 
[22:10:45] console.error: ReferenceError: Can't find variable: sqlitePlugin 
[22:10:45] console.error: Unable to open database: 

```

I have installed the `cordova-sqlite-storage`, followed [this guide about SQLite](http://ionicframework.com/docs/v2/native/sqlite/), and followed the [installation steps](http://ionicframework.com/docs/v2/getting-started/installation/). I also did this `xcode-select --install` to make sure cordova would work with xcode, but nothing works.

Any ideas how I can make the sqlite plugin work with the emulator?

---

<div class="post-metadata">

**Author:** ![Tecnoin](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@Tecnoin](https://forum.ionicframework.com/u/Tecnoin)\
**Post date:** [November 30, 2016, 11:12am UTC](https://forum.ionicframework.com/t/sqlite-plugin-not-woking-in-ios-simulator/71058/2 "2016-11-30T11:12:18Z")

</div>

Hi, i have the same problem. Did you find a solution?

---

<div class="post-metadata">

**Author:** ![johnedvard](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/johnedvard/32/99814_2.png) [@johnedvard](https://forum.ionicframework.com/u/johnedvard)\
**Post date:** [November 30, 2016, 11:30am UTC](https://forum.ionicframework.com/t/sqlite-plugin-not-woking-in-ios-simulator/71058/3 "2016-11-30T11:30:10Z")

</div>

Hello. Unfortunately, I was not able to solve the problem. I decided to skip Ionic in my projects, and started using Angular 2 with a front-end framework instead. I am having such a hard time to get ionic to work. At least, that’s my experience.

I am using IndexedDb instead, utilizing the built-in-databse in the browsers. If you happen to solve the issue, feel free to post the answer here.
