-
Notifications
You must be signed in to change notification settings - Fork 44
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
open_failed #47
Comments
What do you mean it was created on iOS? Could you try opening it with an empty password, maybe the db you are using is not encrypted? |
The password is right The encrypted database is created with IOS app Can open with SQLite studio(an app on Mac OS) It was tested using the Android emulator The API used is 30 |
Is it a database that you copy from assets? Can I see the code where you do that? |
Using file browsing tool directly Copy dB from iPhone app document directory Put it in the corresponding directory of Android simulator Then open it from the flutter project Directory documentsDir = await getApplicationDocumentsDirectory();
|
Now that I see the code, it reminds me of an issue I had on my app long ago for using readOnly. Can you try disabling the readOnly? |
I found the problem The DB can be opened by placing it in the databases folder |
That's odd. I have some code that opens a database in a temporary directory and it works correctly. |
Failed to open encrypted database
The database was created on the IOS platform
Sqlitestudio can be opened
What's going on
I/flutter ( 7114): /data/user/0/com.ying.product_show/app_flutter/factoryNew.db
D/Sqflite ( 7114): Opening db in /data/user/0/com.ying.product_show/app_flutter/factoryNew.db with PRAGMA cipher_migrate
E/flutter ( 7114): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: DatabaseException(open_failed /data/user/0/com.ying.product_show/app_flutter/factoryNew.db)
E/flutter ( 7114): #0 SqfliteSqlCipherDatabaseFactoryImpl.wrapDatabaseException (package:sqflite_sqlcipher/src/factory_sql_cipher_impl.dart:44:9)
E/flutter ( 7114):
E/flutter ( 7114): #1 SqfliteDatabaseMixin.openDatabase (package:sqflite_common/src/database_mixin.dart:558:9)
E/flutter ( 7114):
E/flutter ( 7114): #2 SqfliteDatabaseMixin.doOpen (package:sqflite_common/src/database_mixin.dart:651:22)
E/flutter ( 7114):
E/flutter ( 7114): #3 SqfliteDatabaseOpenHelper.openDatabase (package:sqflite_common/src/database.dart:44:7)
E/flutter ( 7114):
E/flutter ( 7114): #4 SqfliteDatabaseFactoryMixin.openDatabase. (package:sqflite_common/src/factory_mixin.dart:112:18)
E/flutter ( 7114):
E/flutter ( 7114): #5 ReentrantLock.synchronized. (package:synchronized/src/reentrant_lock.dart:37:18)
E/flutter ( 7114):
E/flutter ( 7114): #6 BasicLock.synchronized (package:synchronized/src/basic_lock.dart:33:16)
E/flutter ( 7114):
E/flutter ( 7114): #7 Provider.init (package:product_show/manager/db/provider.dart:99:14)
E/flutter ( 7114):
E/flutter ( 7114): #8 main (package:product_show/main.dart:13:3)
E/flutter ( 7114):
E/flutter ( 7114):
Application finished.
The text was updated successfully, but these errors were encountered: