open failed in ios 15.2 #58
Replies: 33 comments
-
Has anyone encountered this problem? |
Beta Was this translation helpful? Give feedback.
-
Can you run the following to check if SQLCipher is being loaded properly? final db = await openDatabase(":memory:");
final rows = await db.rawQuery("PRAGMA cipher_version");
print(rows[0]); It should say something like "SQLCipher Community version 4.x" |
Beta Was this translation helpful? Give feedback.
-
And another thing I've just noticed. You shouldn't need both sqflite and sqflite_sqlcipher in the pubspec. This library already exposes the same functions and API from sqflite |
Beta Was this translation helpful? Give feedback.
-
PRAGMA return null and my problem is the same as described in this link https://developer.apple.com/forums/thread/697001 |
Beta Was this translation helpful? Give feedback.
-
this is my pubspec.yaml environment: dependencies: image_picker: ^0.8.4 flutter_bloc: ^7.2.0 logger: ^1.1.0 intl: ^0.17.0 flutter_secure_storage: ^4.2.1 flutter_screenutil: ^5.0.0+2 flutter_svg: ^0.22.0 path: ^1.8.0 photo_view: ^0.12.0 flutter_sound: ^8.3.10 qr_code_scanner: ^0.5.2 web3dart: ^2.3.1 nkn_sdk_flutter: dev_dependencies: flutter: uses-material-design: true assets: flutter_intl: |
Beta Was this translation helpful? Give feedback.
-
There is another thing you can try. There was one time when SQLCipher was not being loaded for me because one native dependency on iOS was linking explicitly with SQLite. Unfortunately I don't know what else could be happening. An app I have with this package works correctly on iOS 15.2 |
Beta Was this translation helpful? Give feedback.
-
I just checked my "Other Linker Flags" and it always has "-framework SQLCipher" in it. |
Beta Was this translation helpful? Give feedback.
-
That sounds really odd. I don't see how an iOS upgrade can affect the SQLCipher library in the app binary. |
Beta Was this translation helpful? Give feedback.
-
I haven't tried the emulator, but all users in my app who upgraded to ios15.2 had this problem. |
Beta Was this translation helpful? Give feedback.
-
It suddenly occurred to me that the emulator cannot be upgraded. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem after upgrading to iOS 15.2 on my own phone. |
Beta Was this translation helpful? Give feedback.
-
Can you try to reproduce it in the example app of this repository? That way we could tell if it's related to this or is some other issue. |
Beta Was this translation helpful? Give feedback.
-
I haven't been able to reproduce the issue yet because I don't have the right equipment around. |
Beta Was this translation helpful? Give feedback.
-
You should try without any other dependency in the pubspec. I have a feeling that it could be a conflict with some dependency. |
Beta Was this translation helpful? Give feedback.
-
Not able to access database when updating in android 15.2 and above. Same issue |
Beta Was this translation helpful? Give feedback.
-
@davidmartos96 Flutter application |
Beta Was this translation helpful? Give feedback.
-
But in terms of updating, what are you changing in the application? Are you simply running the app in the new iOS and it fails? |
Beta Was this translation helpful? Give feedback.
-
updating the new version of flutter app from App Store |
Beta Was this translation helpful? Give feedback.
-
@navjyot11singh @jiangzhiguo1992 Can you try the following when opening the database? It's possible that previously SQLCipher wasn't being linked properly and the database was using normal SQLite (no encryption), so now providing the password won't open the database. late final Database db;
try {
db = await openDatabase(file, password: '1234');
} catch(e) {
db = await openDatabase(file, password: '');
}
|
Beta Was this translation helpful? Give feedback.
-
I've tried await openDatabase(file, password: '') and await openDatabase(file) but unfortunately this still doesn't work. |
Beta Was this translation helpful? Give feedback.
-
@jiangzhiguo1992 Are you able to reproduce the issue with the iOS Simulator? If so, please create a repository with a basic app that reproduces the error and with the steps to make it appear. As of right now I'm not able to debug the issue. |
Beta Was this translation helpful? Give feedback.
-
I've found a place at the moment and don't know if it helps with my problem.
And int rc = sqlite3_key(_db, [keyData bytes], (int)[keyData length]); the return value is SQLITE_MISUSE(21), not SQLITE_OK(0). |
Beta Was this translation helpful? Give feedback.
-
@jiangzhiguo1992 That sounds relevant. Do you have a repository I can try? |
Beta Was this translation helpful? Give feedback.
-
@jiangzhiguo1992 Did you include the Also, remember that you don't need to include sqflite in your pubspec. With just dependency_overrides:
sqflite:
git:
url: https://www.github.com/davidmartos96/sqflite_sqlcipher.git
path: sqflite
ref: fmdb_override |
Beta Was this translation helpful? Give feedback.
-
After I set |
Beta Was this translation helpful? Give feedback.
-
@jiangzhiguo1992 So with the dependency_overrides you get the PRAGMA correctly, and without it you don't get any output right? At the start of the thread you mentioned the PRAGMA wasn't working. |
Beta Was this translation helpful? Give feedback.
-
Yes, I found that adding |
Beta Was this translation helpful? Give feedback.
-
I also found that if I add |
Beta Was this translation helpful? Give feedback.
-
@jiangzhiguo1992 that looks ok now. |
Beta Was this translation helpful? Give feedback.
-
I have now obtained the database file in question and sent it to your e-mail. |
Beta Was this translation helpful? Give feedback.
-
After ios upgrade to 15.2.1, encrypted database open failed.
sqflite: ^2.0.2
sqflite_sqlcipher: ^2.1.0
2022-01-24 17:26:59.672175+0800 Runner[2338:552005] Unknown error calling sqlite3_step (26: file is not a database) rs
2022-01-24 17:26:59.672959+0800 Runner[2338:552005] Unknown error calling sqlite3_step (26: file is not a database) eu
2022-01-24 17:26:59.673004+0800 Runner[2338:552005] DB Query: BEGIN EXCLUSIVE
2022-01-24 17:26:59.673042+0800 Runner[2338:552005] Unknown error finalizing or resetting statement (26: file is not a database)
2022-01-24 17:26:59.673064+0800 Runner[2338:552005] DB Query: BEGIN EXCLUSIVE
2022-01-24 17:26:59.673328+0800 Runner[2338:552009] flutter: 17:26:59:error DatabaseException(Error Domain=FMDatabase Code=26 "file is not a database" UserInfo={NSLocalizedDescription=file is not a database}) sql 'BEGIN EXCLUSIVE' args [] during open, closing...
2022-01-24 17:26:59.673465+0800 Runner[2338:552005] Error calling sqlite3_step (1: cannot rollback - no transaction is active) SQLITE_ERROR
2022-01-24 17:26:59.673507+0800 Runner[2338:552005] DB Query: ROLLBACK
2022-01-24 17:26:59.673540+0800 Runner[2338:552005] Unknown error finalizing or resetting statement (1: cannot rollback - no transaction is active)
2022-01-24 17:26:59.673568+0800 Runner[2338:552005] DB Query: ROLLBACK
Beta Was this translation helpful? Give feedback.
All reactions