Latest version 3.5.8 used by means of the native file doesn't find "net.sqlcipher.database.SQLiteDatabase" class


SQLCipher for Android version:

Previously we used v3.4.0, however, since Google has announced a security update for next August 2018, we are trying to migrate as soon as possible to targetSDK 26, and this version wasn’t supporting Android N, therefore we thought moving to 3.5.8 is the right decision. However this version crashes after setting up sqlcipher for Android and trying to be loaded from a static initialiser. Read the following:

Expected Behavior
Latest version 3.5.8 used by means of the compiled file from Native land should work normally when loading its .so file at the Android land.

Actual Behavior
Crashes with crash:
12-28 12:17:42.139 10121-10156/? A/zygote:] No pending exception expected: java.lang.ClassNotFoundException: Didn't find class "net.sqlcipher.database.SQLiteDatabase" on path: DexPathList[[zip file "/data/app/"],nativeLibraryDirectories=[/data/app/, /data/app/!/lib/armeabi-v7a, /system/lib, /vendor/lib]]

Steps to Reproduce
The library is required at our project to be used as a .so file since it’s used by other libraries like odb 2.4.
Proguard was used as suggested at a previous issue like:
-keep class net.sqlcipher.** { *; }
but both with and without proguard this doesn’t work. Proguard is at the build.gradle from the app, buildType release has included
with the reference to that file:
LOCAL_MODULE := sqlcipher LOCAL_SRC_FILES := $(ROOT_PATH)/../../android-database-sqlcipher/android-database-sqlcipher/src/main/libs/$(TARGET_ARCH_ABI)/

and loads it by means of:

static { System.loadLibrary("c++_shared"); System.loadLibrary("sqlcipher"); }
The Android project launches the app, and tries to load this file, and fails crashing.


Hi @raulh

We switched from stlport_shared to stlport_static between 3.4.0 and 3.5.8. I wonder if that is a cause of your issue? Are you using the commercial, or community edition of SQLCipher for Android?


SQLCipher Community Edition since it’s the one provided at the github repo, isn’t?


this can’t be changed: LOCAL_SHARED_LIBRARIES += sqlcipher
since this points to a .so file compiled from your instructions being the resulting


since I am referencing a .so file , the official documentation says

Include PREBUILT_SHARED_LIBRARY or PREBUILT_STATIC_LIBRARY, depending on whether you are using a shared (.so) or static (.a) library. This means I should include it as I did first:

LOCAL_MODULE := sqlcipher_android LOCAL_SRC_FILES := $(ROOT_PATH)/../../thirdparty/android-database-sqlcipher/android-database-sqlcipher/src/main/libs/$(TARGET_ARCH_ABI)/


and at the end of
LOCAL_SHARED_LIBRARIES += sqlcipher_android


Hi @raulh

I’m sorry if I was unclear. I was suggesting that you change the SQLCipher for Android build to utilize stlport_shared, also include the new loading for that here and see if it makes a difference for your project.