Problems with migrate to sqlcipher-android

Hello. I have problem with migrate my project to sqlcipher-android.
I changed this:
implementation ‘net.zetetic:android-database-sqlcipher:4.5.4@aar’
SQLiteDatabase.loadLibs(this);
to this:
implementation ‘net.zetetic:sqlcipher-android:4.10.0@aar’
System.loadLibrary(“sqlcipher”);

and all old imports to new ones from new dependency. But when I run my application, it crash on starts with error:
java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sqlcipher/database/SQLiteOpenHelper;
Caused by: java.lang.ClassNotFoundException: Didn’t find class “net.sqlcipher.database.SQLiteOpenHelper” on path: DexPathList

It looks like it search the old one class from old dependency, but I dont know why because I deleted everything old. Please help me with this

Hi @kamil.krusiec,

You will need to change your imports when you migrate to sqlcipher-android. The SQLiteOpenHelper is located in net.zetetic.database.sqlcipher. We have a migration guide available here[1].


  1. ↩︎

As I wrote, I followed these instructions and replaced all imports with the new ones. I don’t have any imports from the old library anywhere in the entire project, yet I still get this error when launching the application.

Hi @kamil.krusiec,

You may need to review your dependencies to see if you have a transitive dependency on android-database-sqlcipher as something within your project appears to still be referencing android-database-sqlcipher. sqlcipher-android does not depend on android-database-sqlcipher.