I have made changes to migrate
implementation ‘net.zetetic:android-database-sqlcipher:3.5.9’ to
implementation ‘net.zetetic:sqlcipher-android:4.5.5’
implementation ‘androidx.sqlite:sqlite:2.2.0’
and followed below link for migration
https://www.zetetic.net/sqlcipher/sqlcipher-for-android-migration/
My helper class extends SQLiteOpenHelper
public SQLiteDatabase getDatabase() {
if(database == null){
System.loadLibrary(“sqlcipher”);
database = getWritableDatabase();
}
return database;
}
whenever I install apk with the changes
at getWritableDatabase() crash occurs
Failed to open database ‘/data/user/0/com.ticketleap.android.checkinapp/databases/ticketleap_app’.
android.database.sqlite.SQLiteException: file is not a database (code 26): , while compiling: PRAGMA journal_mode
at net.zetetic.database.sqlcipher.SQLiteConnection.nativePrepareStatement(Native Method)
at net.zetetic.database.sqlcipher.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:973)
at net.zetetic.database.sqlcipher.SQLiteConnection.executeForString(SQLiteConnection.java:671)
at net.zetetic.database.sqlcipher.SQLiteConnection.setJournalMode(SQLiteConnection.java:350)
at net.zetetic.database.sqlcipher.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:324)
at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:246)
at net.zetetic.database.sqlcipher.SQLiteConnection.open(SQLiteConnection.java:202)
at net.zetetic.database.sqlcipher.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:474)
at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:189)
at net.zetetic.database.sqlcipher.SQLiteConnectionPool.open(SQLiteConnectionPool.java:181)
at net.zetetic.database.sqlcipher.SQLiteDatabase.openInner(SQLiteDatabase.java:1028)
at net.zetetic.database.sqlcipher.SQLiteDatabase.open(SQLiteDatabase.java:1013)
at net.zetetic.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:840)
at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:359)
at net.zetetic.database.sqlcipher.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:278)
at com.ticketleap.android.common.services.DatabaseHelper.getDatabase(DatabaseHelper.java:92)
at com.ticketleap.android.common.services.DatabaseHelper.clearTables(DatabaseHelper.java:98)
at com.ticketleap.android.common.services.DatabaseHelper$StoreUserTicketListTask.doInBackground(DatabaseHelper.java:114)
at com.ticketleap.android.common.services.DatabaseHelper$StoreUserTicketListTask.doInBackground(DatabaseHelper.java:108)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)