# Unable to find sqlcipher\_android in two devices

**URL:** <https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194>\
**Category:** SQLCipher\
**Created:** [February 26, 2016, 3:50am UTC](https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194 "2016-02-26T03:50:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiMingjian](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@LiMingjian](https://discuss.zetetic.net/u/LiMingjian)\
**Post date:** [February 26, 2016, 3:50am UTC](https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194/1 "2016-02-26T03:50:58Z")

</div>

I use libsqlcipher\_android.so in Unity by using DllImport.  
I have tested some devices and they were running fine. However, when I installed the app in Vivo Y22 and Hongmi 1, I got the error message:  
Unable to find sqlcipher\_android.

I replaced libsqlcipher\_android by using another [libsqlite3.so](http://libsqlite3.so) which does not have function of key,rekey, and renamed [libsqlite3.so](http://libsqlite3.so) to libsqlcipher\_android.so. the app became fine.

I am so confused and try to find out the reason, but failed.

## Could you help me? thanks.

log--------------------------- :  
Unity Unable to find sqlcipher\_android  
Unity DllNotFoundException: sqlcipher\_android  
Unity at (wrapper managed-to-native)Mono,Data,Sqlite.UnsafeNativeMethods:sqlite3\_open\_v2(byte[], intptr&, int intptr)

DllImport------------------:  
[DllImport(SQLITE\_DLL)]  
internal static extern int sqlite3\_open\_v2(byte[] utf8Filename, out IntPtr db, int flags, IntPtr vfs);

Environment---------------：  
VIVO Y22: Funtouch OS based on Android 4.2.2, CPU 1.3GHz Quad-Core  
Hongmi 1:MIUI V5 based on Android 4.2.1 CPU MT6589T

---

<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:** [February 26, 2016, 1:58pm UTC](https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194/2 "2016-02-26T13:58:17Z")

</div>

Hi @LiMingjian

Using a standard SQLite library will not provide the ability to encrypt the database like SQLCipher. I believe the Vivo Y22 is using an ARM Cortex A7 CPU with an aremabi-v7a architecture. What is the architecture of the native library you have been deploying so far?

---

<div class="post-metadata">

**Author:** ![LiMingjian](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@LiMingjian](https://discuss.zetetic.net/u/LiMingjian)\
**Post date:** [February 27, 2016, 12:20am UTC](https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194/3 "2016-02-27T00:20:31Z")

</div>

My program which uses armv7 can be used normally in Nexsu6, Samsung Galaxy 4, Huawei honor, oppo, zuk and mx5, but failed in vivo Y22 and Hongmi 1.

arm, armv7 and x86 were tested in a simple program,  
3.1.0 and 3.3.1 both were tested.  
but none of them was worked.

## Have you found this error before? I don’t want to believe that sqlcipher has problem. Maybe unity has bugs on building apk. Maybe I should pay attention to libdatabase\_sqlcipher.so && libstlport\_shared.so. But I think it is unnecessary if I call libsqlcipher\_android.so by using DllImport. Is it enough that I only import libsqlcipher\_android.so in my Unity3D application.

## Update: I write a android application following [https://www.zetetic.net/sqlcipher/sqlcipher-for-android/](https://www.zetetic.net/sqlcipher/sqlcipher-for-android/). It works fine. I think it is wrong that using DllImport to call libsqlcipher\_android.so， but I am not sure

Update2:  
I have write a example java android application.  
if I only use System.loadlib(“sqlcipher\_android”);, I works fine in other devices expect Vivo Y22 && Hongmi 1  
if I use System,loadlib(“lstlport\_shared”); and System.loadlib(“sqlcipher\_android”), It works fine in Hongmi 1.  
Does it mean that sqlcipher\_android depences on stlport\_shared?

* * *

Finished：  
Sqlcipher\_android depends on stlport\_shared actually. I load stlport\_shared first and load another later, the application works.

But I still do not know the database\_sqlcipher’s functions.

---

<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:** [February 29, 2016, 5:34pm UTC](https://discuss.zetetic.net/t/unable-to-find-sqlcipher-android-in-two-devices/1194/4 "2016-02-29T17:34:21Z")

</div>

Hi @LiMingjian

I’m glad to hear you were able to resolve the issue. Take care!
