I'm using Ionic 3 SQLite native plugin from Here(Ionicframework.com), and Here's my constructor code :
constructor(public navCtrl: NavController,
public menu: MenuController,
translate: TranslateService,
private tts: TextToSpeech,
private sqlite: SQLite) {
this.sqlite.create({
name: 'data.db',
location: 'default'
}).then((db: SQLiteObject) => {
db.executeSql('create table IF NOT EXISTS `localflags`(`flag1` VARCHAR(10),`flag2` VARCHAR(10),`flag3` VARCHAR(10), `flag4` VARCHAR(10));', {})
.then(() => console.log('Table created!!!'))
.catch(e => console.log(e));
}).catch(e => console.log(e));
}
So, when I run it on device using "ionic cordova run android -lc" it give me this error,
Can't resolve all parameters for SQLiteObject: (?)
This code is from the ionic native documentation. This is very basic code, and I'm new to this, so I can't figure out what's wrong with this.
Any help will be appreciated. And if someone can point me to the Ionic 3 SQLite tutorials , that will be great. Thanks in Advance.
Actually, the case was, I had Done import { SQLite, SQLiteObject } from '@ionic-native/sqlite';
this in my ts file, So I thought both SQLite and SQLiteObject are needed to imported in app.module.ts
file, but after reading this answer, I removed SQLiteObject
from app.module.ts
file and also removed injection of SQLite from the constructor and it worked.
Hope this helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With