-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encryption Example - libsqlite3.so not found #2973
Comments
Thanks for the report! In that example, we're using this to override how we open sqlcipher: drift/examples/encryption/lib/main.dart Lines 11 to 16 in 9c28a06
Problematically, we're also using |
Thank you for your prompt response! The 'libsqlite3.so' error has been resolved, but I encountered a new error on the Android emulator: SqliteException(26): while executing, file is not a database, file is not a database (code 26) My cipher_version is 4.5.7 community. Upon investigation, I discovered that changing the database name from 'File(p.join(path.path, 'app.db.enc'))' to 'File(p.join(path.path, 'app.db.sqlite'))' resolves the issue. It appears that the database file was previously created but not encrypted due to the 'libsqlite3.so not found' error. After updating the isolateSetup code, it attempted to encrypt the existing database file, leading to the 'file is not a database' error. This error occurs because we can only encrypt a new database file, not an existing one. I extracted the 'app.db.sqlite' file from the Android emulator and opened it with SQLiteStudio successfully. I was able to open the database file using the SQLCipher type with a password. I was stuck on this issue for three days, but your revised code and explanation saved my day! |
hi, i tried to flutter run the examples/encryption in my android emulator but got the below error:
I/flutter (13408): Error loading data: Invalid argument(s): Failed to load dynamic library '/data/data/com.example.drift_encryption_sample/lib/libsqlite3.so': dlopen failed: library "/data/data/com.example.drift_encryption_sample/lib/libsqlite3.so" not found
below is my pubspec.yaml:
dependencies:
sqflite: ^2.3.0
drift_sqflite: ^2.0.1
drift: ^2.0.2+1
sqlcipher_flutter_libs: ^0.6.0
flutter:
sdk: flutter
path_provider: ^2.0.11
path: ^1.8.1
sqlite3: '>=1.8.0 <3.0.0'
I noticed the package sqlcipher_flutter_libs will not generate libsqlite3.so into the build folder..
The text was updated successfully, but these errors were encountered: