SQLCipherDB crash in Samsung S8 and Pixel phones



Getting the following crash reported in Google Play store from Samsung S8 and Google Pixel phones.

at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1567)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:196)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:189)
at com.xxx.xxxx.xxxxxx.SQLCipherDBManager.initializeInstance(SQLCipherDBManager.java:33)
at com.xxx.xxxx.xxxxxx.MyApplication.onCreate(MyApplication.java:118)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5970)

I am not able to reproduce this crash on a Samsung S8 test device I have but I see this crash reported by number of users in Playstore.
I am using sqlcipher version 3.5.4 and have the dependency in my build.gradle.

compile ‘net.zetetic:android-database-sqlcipher:3.5.4@aar’

Currently I have added support for armeabi, armeabi-v7a, and x86 only by including the ndk abifilter in build.gradle.

ndk {
abiFilters “armeabi”, “armeabi-v7a”, “x86”

after building the apk I did reverse engineer to see if I have any other 3rd party dependencies which have x64 or x86_64 native libraries but I do not see any. I see only armeabi, armeabi-v7a and x86 folders with native libraries related to SQLChiper.

Screen Shot 2017-06-08 at 12.33.36 PM

Any inputs would be of great help!


Hi @Cris

I don’t have an S8 device to test, but the Android implementation of loadLibrary(…) maybe attempting to load based on either the arm64-v8a, or x86_64 platform. Are you able to get 64-bit builds of pdfium? If so, you may be able to remove your abiFilter. You might also consider updating to the latest version of SQLCipher for Android, currently at 3.5.7 to see if the behavior is the same or not. Finally, and a non-ideal approach, you could investigate providing your own LibraryLoader implementation for your call to SQLiteDatabase.loadLibs(…), bifurcating from the default for the devices of issue.