Updating from android-database-sqlcipher to sqlcipher-android

Hi, my application has been using android-database-sqlcipher for quite some years now. Today I got the following message from playstore

net.zetetic:android-database-sqlcipher has reported android-database-sqlcipher:3.5.9 as outdated. You may not be able to release future versions of your app with this SDK version to production or open testing.

so I replaced implementation ‘net.zetetic:android-database-sqlcipher:3.5.9@aar’ with implementation ‘net.zetetic:sqlcipher-android:4.5.5@aar’

But on doing that I am getting this issue

Task :maxRVU:mergeMaxrvuDebugNativeLibs FAILED
Execution failed for task ‘:maxRVU:mergeMaxrvuDebugNativeLibs’.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
2 files found with path ‘lib/arm64-v8a/libsqlcipher.so’ from inputs:
- /Users/ashish/.gradle/caches/transforms-3/47cad2ebd25762db6d4f72d65143456b/transformed/jetified-sqlcipher-android-4.5.5/jni/arm64-v8a/libsqlcipher.so
- /Users/ashish/.gradle/caches/transforms-3/ff8ddd5b58a3b5727c6ff94414d581dd/transformed/jetified-android-database-sqlcipher-3.5.9/jni/arm64-v8a/libsqlcipher.so

Can you help me with what I can do to fix this issues?

Thank you.

Hi @Ashish_Nair,

This post appears to have been cross posted to GitHub here. If that is not the case, please let us know.

Hi, thanks for the reply. Although it’s the same issue that I posted on github but I still haven’t got the solution to my issue. Can you please help me with that?

Thanks in advance.

Hello @Ashish_Nair,

It would be best to keep all communication in a single location. At this point, would you please reply to the ongoing thread on GitHub? Thanks!

1 Like

Hi @developernotes , so when I upgraded to “net.zetetic:android-database-sqlcipher:4.2.0@aar” & “com.commonsware.cwac:saferoom.x:1.0.0” & ran the application I got this error “Caused by: net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;”. But when I uninstall the application & re-run it again then it works. This is my code.

mInstance = Room.databaseBuilder(context,
MaxRVURewampDatabase.class, “MaxRVU-db.sql”)
.openHelperFactory(factory)
.allowMainThreadQueries()
.addMigrations(MIGRATION_1_2)
.build();

Can you help me in identifying what could be the issue here? Thanks in advance.

Hi @Ashish_Nair,

It sounds like you are upgrading from SQLCipher 3.x to 4.x. Due to the introduction of new default algorithms, increased KDF iterations and a larger page size SQLCipher 4 will not open older databases by default. We have posted recommended approached to addressing this here: