SQLCipher on Android API 16/17 doesn't work

Hi there,

Let me explain our situation… We have a cpp layer in our application which we are trying to get SQLCipher working for. The cpp layer in compiled with the NDK and loaded as a .so library. We have added libsqlcipher_android.so as a dependency for the cpp layer like this…

LOCAL_MODULE := libsqlcipher_android
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libsqlcipher_android.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../../cpp/thirdparty/include

This works great with API 18+ but any version of the API older than this fails. Our app compiles fine, however when System.loadLibrary() on our cpp NDK .so is called, the UnsatisfiedLinkError exception is thrown.

Any help with this would be greatly appreciated.

Hello @Stoff81

Can you just specify LOCAL_LDLIBS += lsqlcipher_android along with specifying the appropriate path in LOCAL_LDFLAGS when building your cpp module within the NDK? If not, are you deploying libsqlcipher_android.so?

Resolved this issue, it was due to a bug in the NDK…
Needed to define these in the .mk file:
APP_STL := stlport_shared
APP_MODULES := stlport_shared sqlcipher_android

Thanks for your help

Hi @Stoff81

We are glad to hear everything is has been resolved.