PRAMA cipher_migrate with v4.5.6 crashes on Android 8 at first launch

Hi,

I am doing the SQLCipher version upgrade from v4.5.4 to v4.5.6.
The version upgrade is working for the most of the Android versions like 11,12,13, etc.
But when I tried the same on Android 8, the App crashes on the first launch only. On the successive launch, it works fine.
We have observed the below AndroidRuntime logs:

04-16 07:04:04.560 14162 15999 E SQLiteDatabase: android.database.sqlite.SQLiteDoneException
04-16 07:04:04.560 14162 15999 E SQLiteDatabase: at net.zetetic.database.sqlcipher.SQLiteConnection.nativeExecuteForLong(Native Method)
04-16 07:04:04.560 14162 15999 E SQLiteDatabase: at net.zetetic.database.sqlcipher.SQLiteConnection.executeForLong(SQLiteConnection.java:635)


04-16 07:04:04.561 14162 15999 E WS1_AppWrapperContentProvider: Awdb: getWritableDatabase error android.database.sqlite.SQLiteDoneException
04-16 07:04:04.561 14162 14162 V WS1_Utils: isUserUnlocked: true

I have used:
sqLiteConnection.executeForLong(“PRAGMA cipher_migrate;”, arrayOf(), null) method for migration.

If I am using
sqLiteConnection.executeRaw(“PRAGMA cipher_migrate;”, arrayOf(), null), the crash deos not occur on Android 8 but it starts showing error on Android 11,12,13 as file is not database(26).

Can you let us know if something like this is known and we have some solution this?

We have followed the guide to migrate to v4.5.6.

Hi @Gaurav_Verma,

You do not need to execute PRAGMA cipher_migrate from 4.5.4 to 4.5.6 as they are both the same major version number.

We have a migration code for 3 → 4 only. Previously we were using v4.5.4 version where 3->4 migration was working. Now we have moved to use v4.5.6 where the same migration occurs.
We are facing issue only on Android 8 first launch. App crashes.
Pulled the log from Bug report also:

04-17 10:42:06.388 1000 3609 5285 I am_crash: [11943,0,package,955792966,android.database.sqlite.SQLiteDoneException,An error occurred while executing doInBackground(),SQLiteConnection.java,-2]

Hi @Gaurav_Verma,

Please pull the SQLCipher 3 database off the device locally and attempt to run the PRAGMA cipher_migrate command from the SQLCipher command line interface. What does that report?