sqlite3.dart icon indicating copy to clipboard operation
sqlite3.dart copied to clipboard

libsqlite3.so not found

Open mprogers opened this issue 4 years ago • 1 comments

I've got a nice-looking app running on macOS and iOS, but I am having a whole lot of difficulty with the Android version: I'm getting this error:

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

My dependencies are: flutter: sdk: flutter sqlite3: ^1.4.0

I also tried these dependencies:

dependencies: flutter: sdk: flutter sqlite3: ^1.4.0 provider: ^6.0.0

cupertino_icons: ^1.0.2 fl_chart: ^0.40.6 sqlite3_flutter_libs: ^0.5.2

import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart'

But then I get this error: SqliteException(14): bad parameter or other API misuse, bad parameter or other API misuse (code 21)

Ah, it might be because it can't find the location of the .sqlite file itself. I'll keep digging ...

mprogers avatar Dec 31 '21 19:12 mprogers

Depending on sqlite3_flutter_libs should be enough.

If you get SqliteException(14): bad parameter or other API misuse, bad parameter or other API misuse (code 21), sqlite3 has already been loaded successfully - it's just throwing an exception. Can you post the trace of that exception? If it happens when creating a new database file, it might be that the parent directory doesn't exist? (You need to create it with dart:io first).

simolus3 avatar Jan 01 '22 14:01 simolus3

I just had this issue on android 14, were you using sqlcipher_flutter_libs? I removed cypher to resolve it, but I wanted cypher back.

AndreLuizNogueira avatar Oct 01 '24 19:10 AndreLuizNogueira