# SQLCipher on Android API 16/17 doesn't work

**URL:** <https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763>\
**Category:** SQLCipher\
**Created:** [September 16, 2015, 2:41pm UTC](https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763 "2015-09-16T14:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stoff81](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/stoff81/32/185_2.png) [@Stoff81](https://discuss.zetetic.net/u/Stoff81)\
**Post date:** [September 16, 2015, 2:41pm UTC](https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763/1 "2015-09-16T14:41:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [September 16, 2015, 7:37pm UTC](https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763/2 "2015-09-16T19:37:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Stoff81](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/stoff81/32/185_2.png) [@Stoff81](https://discuss.zetetic.net/u/Stoff81)\
**Post date:** [September 17, 2015, 10:13am UTC](https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763/3 "2015-09-17T10:13:45Z")

</div>

> [@developernotes](#):
>
> LOCAL\_LDLIBS

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

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [September 17, 2015, 1:08pm UTC](https://discuss.zetetic.net/t/sqlcipher-on-android-api-16-17-doesnt-work/763/4 "2015-09-17T13:08:06Z")

</div>

Hi @Stoff81

We are glad to hear everything is has been resolved.
