I'm using SQLCIPHER to read or write database getting error I'm using SQLCIPHER to read or write database getting error sqlite sqlite

I'm using SQLCIPHER to read or write database getting error


That error usually occurs if you have not called SQLiteDatabase.loadLibs() before attempting to use the database.


The UnsatisfiedLinkError is due to the native libraries not being included with your application. For an example on integrating SQLCipher with an existing application, please review this tutorial. Alternatively, take a look at the SQLCipher for Android test suite.


@CommonsWare is correct and you down-voted it.

When your app is being resumed from a long sleep, the libs have been cycled out and thus restoring state is crashing because libs are absent.

Put your SQLiteDatabase.loadLibs(this); ahead of super.onCreate(savedInstanceState)

@Overridepublic void onCreate(Bundle savedInstanceState) {    //you must set Context on SQLiteDatabase first    SQLiteDatabase.loadLibs(this);    super.onCreate(savedInstanceState);