Missing libstlport_shared.so

Hi @developernotes,
We’ve recently migrated to Android Studio and also updated our code to use aar with Android Studio. Removed all the .so files previously used in eclipse. Now when we launch our app, its crashing with below stack trace.

FATAL EXCEPTION: main
Process: com.farmers.ifarmers, PID: 30632
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file “/data/app/com.farmers.ifarmers-1/base.apk”],nativeLibraryDirectories=[/data/app/com.farmers.ifarmers-1/lib/arm, /data/app/com.farmers.ifarmers-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn’t find "libstlport_shared.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:173)
at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:169)
at com.farmers.marketing.db.database.SQLCipherDBManager.initializeInstance(SQLCipherDBManager.java:52)
at com.farmers.ifarmers.application.NFarmersApplication.onCreate(NFarmersApplication.java:98)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)

01-13 11:03:00.883 30632-30632/com.farmers.ifarmers E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

I searched all your responses related to the issue, But couldn’t find any answer.

Thanks in advance,
Kiran

Hello @trrkiran007

Can you use the apktool to show the content within the lib folder of your apk?

@developernotes,

Tried using apktool, But it is failing to decode my apk. (my apk is multi dex enabled). will try some other way to extract it

@developernotes,

Attaching the screenshot of the lib folder of extracted apk. To my surprise, I found there are no sql cipher related .so files found in it. I am using “compile ‘net.zetetic:android-database-sqlcipher:3.3.1-2@aar’” as dependency in Android studio.

Thanks,
Kiran

Hi @trrkiran007

Thank you for looking further into your build. I just pulled down a fresh copy of the android-database-sqlcipher-3.3.1-2.aar file from Bintray and all platform specific files are included within the x86 folder (screenshot included below). Is it possible your build process may somehow be excluding them?

@developernotes,

I’ve checked my build files and found no Issues with it. even though I am using dependency in my gradle file, I had to keep jniLibs folder with all the .so files in src to make the app work. (I am using the old v3.3-1 .so files)

App
|
|—src
| | |
| | main
| | | |
| | | jniLibs
| | | |-armeabi
| | | |-armeabi-v7a
| | | |-x86

Hello @trrkiran007

I just created a sample project using gradle in Android Studio, added SQLCipher for Android as a reference, built the APK, finally dumping the binary with apktool. The output of the lib directory from apktool looks like this:

It appears you are depending on other 3rd party libraries. You might try creating a demo application where you add SQLCipher for Android initially, build and verify as I mentioned above, then start adding your additional 3rd party references and any other project specific build adjustments you have, verifying at each step to see where the issue is.