davidmartos96 / sqflite_sqlcipher

SQLite flutter plugin
BSD 2-Clause "Simplified" License
99 stars 44 forks source link

DatabaseException(error code 8: attempt to write a readonly database) #57

Closed prabavgts closed 2 years ago

prabavgts commented 2 years ago

DatabaseException(error code 8: attempt to write a readonly database) sql 'INSERT INTO table name ?

_database = await openDatabase(_databaseName, password: _databaseName, readOnly: false, version: 1, // TODO: Change the version method dynamically onConfigure: onConfigure, onCreate: onCreate, onOpen: onOpen, onUpgrade: onUpgrade );

Already read only database is false. but why this error?

davidmartos96 commented 2 years ago

What's the value of _databaseName?

prabavgts commented 2 years ago

Ex:praba.db

davidmartos96 commented 2 years ago

It's possible that the colon (:) is not valid as a file path. Have you tried using something like "myDatabase.db" for the first argument?

prabavgts commented 2 years ago

I am not using the colon.I am just show for an example

the name of db is praba.db

davidmartos96 commented 2 years ago

Could you share the rest of the code?

prabavgts commented 2 years ago

Works well now..I don't know what the problem is

prabavgts commented 2 years ago
Screenshot 2022-01-31 at 5 52 30 PM

Show this error sometimes. Will you please help me to solve it?

davidmartos96 commented 2 years ago

@PrabavathiKalidoss Without a reproducible sample I wouldn't be able to help you. Could you try creating a repo with a demo that produces the same error?