Skip to content

Attempt to write a readonly database #131

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

Closed
ghost opened this issue Jul 7, 2014 · 0 comments
Closed

Attempt to write a readonly database #131

ghost opened this issue Jul 7, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 7, 2014

When trying to insert content values via ContentProvider on LG G2 in activity.onResume() the application crashes after rotation change.

After rotation change SQLDatebaseHelper.getWirteableDatabase(String password) returns a db, which is readOnly == false, but when trying to insert values getting the following exception

java.lang.RuntimeException: Unable to resume activity {com.example.tmichelc.sqlciphertestapplication/com.example.tmichelc.sqlciphertestapplication.MainActivity}: net.sqlcipher.database.SQLiteException: error code 8: attempt to write a readonly database
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2795)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2824)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3755)
at android.app.ActivityThread.access$900(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5105)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
Caused by: net.sqlcipher.database.SQLiteException: error code 8: attempt to write a readonly database
at net.sqlcipher.database.SQLiteStatement.native_execute(Native Method)
at net.sqlcipher.database.SQLiteStatement.execute(SQLiteStatement.java:58)
at net.sqlcipher.database.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1646)
at net.sqlcipher.database.SQLiteDatabase.insertOrThrow(SQLiteDatabase.java:1528)
at com.example.tmichelc.sqlciphertestapplication.db.encrypted.SQLCipherContentProvider.insert(SQLCipherContentProvider.java:91)
at android.content.ContentProvider$Transport.insert(ContentProvider.java:220)
at android.content.ContentResolver.insert(ContentResolver.java:1206)
at com.example.tmichelc.sqlciphertestapplication.db.base.AbstractContentValues.insert(AbstractContentValues.java:28)
at com.example.tmichelc.sqlciphertestapplication.MainActivity.testWriteToDatabase(MainActivity.java:104)
at com.example.tmichelc.sqlciphertestapplication.MainActivity.onResume(MainActivity.java:75)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
at android.app.Activity.performResume(Activity.java:5354)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2785)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2824)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2255)
            at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3755)
            at android.app.ActivityThread.access$900(ActivityThread.java:139)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
            at android.os.Handler.dispatchMessage(Handler.java:102)

This issue was closed.
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

0 participants