Home > Software design >  Error when using sqflite_common_ffi instead of sqfilte on Android
Error when using sqflite_common_ffi instead of sqfilte on Android

Time:03-09

For targeting mulitple platforms, I want to use sqflite_common_ffi instead of sqflite (sqflite_common_ffi is compatible with Windows).

But when I run my project on Android, I have this exception when runningdatabaseFactoryFfi.openDatabase method:

Invalid argument(s): Failed to load dynamic library '/data/data/com.coutier.scool/lib/libsqlite3.so': dlopen failed: library "/data/data/com.coutier.scool/lib/libsqlite3.so" not found

I do not understand : sqlite not supposed to be included in android ? Why this package want to load a specific library ?

If I really need this library to make sqflite_common_ffi run, where can I find this library and where have I to put in my project tree ?

CodePudding user response:

On iOS and Android, you can add sqlite3_flutter_libs that includes the binaries for iOS and Android. sqflite_common_ffi uses sqlite3 and its default library loader should work as is.

  • Related