# Crashing when running SQL Cipher on Nexus 9

**URL:** <https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639>\
**Category:** SQLCipher\
**Created:** [June 29, 2015, 1:08pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639 "2015-06-29T13:08:13Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 1:08pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/1 "2015-06-29T13:08:13Z")

</div>

My app is crashing when I debug my app on a Nexus 9 tablet with the following error. Crash happening on my loadLibs call. Any insight or help? This is a big problem for me.

SQLCipher 3.3.0 - Android 5.0.2 - Nexus 9

06-29 09:01:25.621: E/AndroidRuntime(3279): FATAL EXCEPTION: main  
06-29 09:01:25.621: E/AndroidRuntime(3279): Process: com.tcoyle.testapp, PID: 3279  
06-29 09:01:25.621: E/AndroidRuntime(3279): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.tcoyle.testapp-1/base.apk”],nativeLibraryDirectories=[/data/app/com.tcoyle.testapp-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn’t find "libstlport\_shared.so"  
06-29 09:01:25.621: E/AndroidRuntime(3279): at java.lang.Runtime.loadLibrary(Runtime.java:366)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at java.lang.System.loadLibrary(System.java:989)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:142)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:137)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at com.tcoyle.testapp.LoginActivity.InitializeSQLCipher(LoginActivity.java:109)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at com.tcoyle.testapp.LoginActivity.onCreate(LoginActivity.java:105)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.Activity.performCreate(Activity.java:5933)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.ActivityThread.access$800(ActivityThread.java:144)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.os.Handler.dispatchMessage(Handler.java:102)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.os.Looper.loop(Looper.java:135)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at android.app.ActivityThread.main(ActivityThread.java:5221)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at java.lang.reflect.Method.invoke(Native Method)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at java.lang.reflect.Method.invoke(Method.java:372)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)  
06-29 09:01:25.621: E/AndroidRuntime(3279): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

---

<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:** [June 29, 2015, 1:28pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/2 "2015-06-29T13:28:01Z")

</div>

Hello @tcoyle

Did you copy all native .so libraries to the `libs` folder within specific platform subfolders? An example can be found in the SQLCipher for Android tutorial [here](https://www.zetetic.net/sqlcipher/sqlcipher-for-android).

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 1:31pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/3 "2015-06-29T13:31:54Z")

</div>

Yes I did. here is a screenshot of my libs folder. I re-did this step several times to no avail.

[screenshot of libs folder](http://i.imgur.com/s5jqINi.png)

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [June 29, 2015, 1:35pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/4 "2015-06-29T13:35:08Z")

</div>

Your app attempts to load arm64 libraries, but SQLCipher for Android does not currently support _any_ 64-bit architectures. There is an open pull request to support SQLCipher for Android on certain 64-bit architectures here: [https://github.com/sqlcipher/android-database-sqlcipher/pull/151](https://github.com/sqlcipher/android-database-sqlcipher/pull/151)

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 1:39pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/5 "2015-06-29T13:39:28Z")

</div>

so it is not possible to run an app with SQL Cipher support on a Nexus 9 (or other 64 bit android device) with the current release as is?

---

<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:** [June 29, 2015, 1:55pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/6 "2015-06-29T13:55:56Z")

</div>

Hello @tcoyle,

SQLCipher for Android in the standard distribution runs fine on a Nexus 9 device. What IDE are you using to build your application?

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 1:57pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/7 "2015-06-29T13:57:49Z")

</div>

Android Studio 1.2.2 - Also if its worth it, up until I got the Nexus 9 device, it was working fine with the Nexus 9 emulator.

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 8:34pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/8 "2015-06-29T20:34:04Z")

</div>

So it appears the inclusion of the PSPDFKit PDF framework causes this error with SQLCipher. I have no idea how to go about preventing this from happening. There is no errors regarding the PDF framework, but as soon as I included it I get the linker error with SQLCipher.

Any suggestions, or questions I should pose to PSPDFKit support? Thanks.

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [June 29, 2015, 9:09pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/9 "2015-06-29T21:09:28Z")

</div>

@tcoyle can you try adding one change at a time from your working project  
until you see exactly which change causes the problem?

---

<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:** [June 29, 2015, 9:12pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/10 "2015-06-29T21:12:37Z")

</div>

Hi @tcoyle

Since you mentioned that you are using Android Studio, it is important to note that the native library structure is slightly different. Could you compare what you have with [this](https://discuss.zetetic.net/t/android-studio-integration/65) tutorial? It may be worth reaching out to the PSPDFKit group to see if they can share any specifics about their dependencies. I would be curious as to their response. When you integrate both SQLCipher for Android and PSPDFKit, which library is initialized first when you receive the runtime exception?

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [June 29, 2015, 9:41pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/11 "2015-06-29T21:41:10Z")

</div>

I followed your blog post about integrating with Android Studio. And it definitely works without PSPDFKit.

I tried reversing the order in which they are included, and initialized, and regardless it always crashes on the loadLibs() call. I will reach out to there support and see what they say.

---

<div class="post-metadata">

**Author:** ![chetan1011](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@chetan1011](https://discuss.zetetic.net/u/chetan1011)\
**Post date:** [July 10, 2015, 6:18am UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/12 "2015-07-10T06:18:07Z")

</div>

Hello @brodybits and @developernotes and @tcoyle

my app is crashing when I debug my app on a A-Lenovo A-7000-a tablet with the following error. Crash happening on my loadLibs call. Any insight or help? This is a big problem for me.

SQLCipher 3.3.0 - Android 5.0 - Lenovo A-7000-a

Eclipse juno - IDE is using to build my application.

please give me solution fast and fast…

here i attach my project structure :

 ![](https://us1.discourse-cdn.com/flex016/uploads/zetetic/original/1X/358b0adff8593d3c7f88929622cd4ec652ff01e9.png)

07-10 11:28:32.040: E/libEGL(25870): cache file failed CRC check  
07-10 11:28:34.097: E/AndroidRuntime(25870): FATAL EXCEPTION: main  
07-10 11:28:34.097: E/AndroidRuntime(25870): Process: com.esense.topscorer, PID: 25870  
07-10 11:28:34.097: E/AndroidRuntime(25870): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.esense.topscorer-2/base.apk”],nativeLibraryDirectories=[/data/app/com.esense.topscorer-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn’t find “libstlport\_shared.so”  
07-10 11:28:34.097: E/AndroidRuntime(25870): at java.lang.Runtime.loadLibrary(Runtime.java:366)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at java.lang.System.loadLibrary(System.java:989)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:118)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:113)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.esense.topscorer.scratchcard.DataBaseHelper.(DataBaseHelper.java:39)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.esense.topscorer.scratchcard.DataInitialization.getInternalData(DataInitialization.java:19)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.esense.topscorer.scratchcard.DataInitialization.setInternalData(DataInitialization.java:34)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.esense.topscorer.scratchcard.BaseActivity.setConnection(BaseActivity.java:95)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.esense.topscorer.scratchcard.LoginActivity.onCreate(LoginActivity.java:54)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.Activity.performCreate(Activity.java:6005)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1111)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2446)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2555)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.ActivityThread.access$800(ActivityThread.java:176)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1437)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.os.Handler.dispatchMessage(Handler.java:111)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.os.Looper.loop(Looper.java:194)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at android.app.ActivityThread.main(ActivityThread.java:5576)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at java.lang.reflect.Method.invoke(Native Method)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at java.lang.reflect.Method.invoke(Method.java:372)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)  
07-10 11:28:34.097: E/AndroidRuntime(25870): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [July 10, 2015, 7:19am UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/13 "2015-07-10T07:19:50Z")

</div>

If you look at the error message carefully, you can see that it is  
searching for the native library a lib64 subdirectory. But sqlcipher for  
Android does not have 64-bit version of native libraries.

---

<div class="post-metadata">

**Author:** ![chetan1011](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@chetan1011](https://discuss.zetetic.net/u/chetan1011)\
**Post date:** [July 10, 2015, 7:29am UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/14 "2015-07-10T07:29:43Z")

</div>

Hello @brodybits,

Thank you so much for kindly replay.

so it is not possible to run an myapp with SQL Cipher support on a Lenovo a-7000a (or other 64 bit android device) with the current release as is?

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [July 10, 2015, 9:13am UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/15 "2015-07-10T09:13:56Z")

</div>

> so it is not possible to run an myapp with SQL Cipher support on a Lenovo  
> a-7000a (or other 64 bit android device) with the current release as is?

Personally I would not expect SQLCipher to work on 64-bit systems. But  
there is already a pull request with some changes to build SQLCipher for  
Android with 64-bit support here:

> <https://github.com/sqlcipher/android-database-sqlcipher/pull/151>
>
> With the 64-bit capable android devices already out there, it is necessary to be… able to have native 64-bit compilation for increased performance. MIPS64 has not been included, because the corresponding AOSP version does not seem to compile.

You would have to build it from source, unless you can find a third-party  
build.

---

<div class="post-metadata">

**Author:** ![tcoyle](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tcoyle](https://discuss.zetetic.net/u/tcoyle)\
**Post date:** [July 10, 2015, 5:54pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/16 "2015-07-10T17:54:43Z")

</div>

SQLCipher is now running perfectly fine on my 64bit Nexus 9.

The problem was that the PSPDFKit framework .aar include had .so include for arm64-v8a - causing the device to exclusively look for arm64-v8a libraries.

I removed the arm64-v8a from the PSPDFKit .aar file, and recompiled and the app and SQLCipher current release run fine.

Perhaps you are experiencing a similar issue chetan1011? Make sure no other frameworks you are including are running 64 bit libraries, as this will force SQLCipher to look for one which it does not currently have.

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [July 10, 2015, 10:14pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/17 "2015-07-10T22:14:23Z")

</div>

> SQLCipher is now running perfectly fine on my 64bit Nexus 9.
> 
> The problem was that the PSPDFKit framework .aar include had .so include  
> for arm64-v8a - causing the device to exclusively look for arm64-v8a  
> libraries.
> 
> I removed the arm64-v8a from the PSPDFKit .aar file, and recompiled and  
> the app and SQLCipher current release run fine.

Thanks tcoyle, I just filed  
[Document 64-bit compatibility · Issue #185 · sqlcipher/android-database-sqlcipher · GitHub](https://github.com/sqlcipher/android-database-sqlcipher/issues/185) to get  
this documented.

---

<div class="post-metadata">

**Author:** ![brodybits](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/brodybits/32/515_2.png) [@brodybits](https://discuss.zetetic.net/u/brodybits)\
**Post date:** [July 15, 2015, 8:25pm UTC](https://discuss.zetetic.net/t/crashing-when-running-sql-cipher-on-nexus-9/639/18 "2015-07-15T20:25:15Z")

</div>

FYI the 64-bit version for Android is waiting for the OpenSSL project to accept the changes in [https://github.com/openssl/openssl/pull/251](https://github.com/openssl/openssl/pull/251). I just filed [https://github.com/openssl/openssl/issues/333](https://github.com/openssl/openssl/issues/333) to ask when they can look at the changes.
