Skip to content
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

Unhandled Exception: Bad state: read only #293

Open
JoelSuyati opened this issue Nov 20, 2021 · 5 comments
Open

Unhandled Exception: Bad state: read only #293

JoelSuyati opened this issue Nov 20, 2021 · 5 comments

Comments

@JoelSuyati
Copy link

while storing data to sembast

@alextekartik
Copy link
Collaborator

More information would help, which platform, database location, some code example...can you write a file at the database location?.

@owenkealey
Copy link

@alextekartik I get the following error when creating a new database:

"Cannot create file OS Error Read only file system" on an iOS 15 simulator on latest MacOS

@alextekartik
Copy link
Collaborator

alextekartik commented Dec 10, 2021

@owenkealey Same response: More information would help, database location, some code example...can you write a file at the database location?.

@m-zaink
Copy link

m-zaink commented Feb 2, 2022

Here is how to fix this-

ref = StoreRef<String, String>.main();

final applicationDirectory = await getApplicationDocumentsDirectory();

final databasePath = applicationDirectory.path + '/twitter.da';

final db = await databaseFactoryIo.openDatabase(databasePath);

You would need to install path_provider plugin to use getApplicationDocuementsDirectory() function.

@SeaRoth
Copy link

SeaRoth commented Apr 24, 2022

Hero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants