Android SQLCipher - attempt to write a readonly database error in android version 5.x and above

467 Views Asked by At

I am facing one problem with sqlcipher since last month.

In my project I use existing database which is stored in raw folder of resources folder.

I open the database by using SQLiteDatabase.openOrCreateDatabase() method. It is working fine in all devices before version 5.0. But It shows me error on Android 5.x and above version with log as follows: I also searched on internet.I found same issues found in link but there is no solution of it. link as: https://github.com/sqlcipher/android-database-sqlcipher/issues/161

Error log as follows:

DELETE failed setting locale 08-13 09:44:58.388: E/Database(6507): Failed to setLocale() when constructing, closing the database 08-13 09:44:58.388: E/Database(6507): net.sqlcipher.database.SQLiteException: attempt to write a readonly database 08-13 09:44:58.388: E/Database(6507): at net.sqlcipher.database.SQLiteDatabase.native_setLocale(Native Method) 08-13 09:44:58.388: E/Database(6507): at net.sqlcipher.database.SQLiteDatabase.setLocale(SQLiteDatabase.java:2098)

0

There are 0 best solutions below