Search code examples
sqlitenativescriptnativescript-plugin

OrCreateDatabase error nativescript sqlite


When I create localDB using nativescript-sqlite plugin it is throwing following error.

SQLITE.CONSTRUCTOR - Open DB Error Error: java.lang.Exception: Failed resolving method open OrCreateDatabase on class android.database.sqlite.SQLiteDatabase

Why it is showing this error


Solution

  • I know it's a few months later but maybe it will help to someone else. I was struggling with same issue for about few hours. In my case root cause was a minor update of nativescript-sqlite dependency from 1.1.7 to a newer one (minor) 1.1.11. Dependency declaration looked like below: "dependencies": { "nativescript-sqlite": "~1.1.7", }, and putting exact version as dependency solved the issue: "dependencies": { "nativescript-sqlite": "1.1.7", }, Of course please reinstall dependencies after patching code. Hope it will save someone time. It's a work-around and probably at the end you'll have to refactor code and update to version 2.x.