Capacitor Sqlite gives 'Error CapacitorSQLitePlugin :null" only in production not all devices

322 Views Asked by At

My Capacitorjs app uses the capacitorcommunity SQLite plugin.

It used to run fine in Production.

After various modifications and plugin updates, which tested fine in development/debug mode. I deployed it to android play-store for testing.

It runs fine in debug mode on a Samsung A53 5G (Android 13) the deployed version on the same device gives error: CapacitorSQLitePlugin :null when calling createConnection.

Install from Playstore to an older device with Android 9 runs fine.

Versions:

  • capacitor/sqlite plugin 5.4.2-2
  • capacitor 5.5.1
  • android 5.5.1

my attempts to resolve:

  • roll back recent updates
  • clean project,
  • clear cache,
  • reinstalled SQLite including some previous versions

All without resolve

Any suggestions on how to proceed?

1

There are 1 best solutions below

0
On

Best regards.

I was just having that same error and after researching in several places, issues; then a solution that worked very well for me and I want to share it. The solution is to add android:allowBackup="false" in the AndroidManifest.xml file; which is located in the path android\app\src\main\AndroidManifest.xml. Then everything is uninstalled and reinstalled.

Thank you for your attention and I hope I could help you.

Reference link: Plugin failed to register in Android 11 physical device Ionic Capacitor SQLite won’t initialize in Android ONLY through the Play Store