3

My app crashed while adding Realm to my project with existing SQLCipher on Samsung Galaxy S6 edge but runs fine on Samsung Note 3.

Crashlogs:-

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/co.xyz.pqr.Alpha-1/base.apk"],nativeLibraryDirectories=[/data/app/co.xyz.pqr.Alpha-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libstlport_shared.so"
                                                                               at java.lang.Runtime.loadLibrary(Runtime.java:366)
                                                                               at java.lang.System.loadLibrary(System.java:988)
                                                                               at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:173)
                                                                               at net.sqlcipher.database.SQLiteDatabase.loadLibs(SQLiteDatabase.java:169)
Vishal Yadav
  • 3,642
  • 3
  • 25
  • 42
Omkar Amberkar
  • 1,952
  • 4
  • 16
  • 21
  • It sounds like you are mixing 32 and 64 bit ARM. Realm supports both but if another library doesn't support 64 bit ARM, you can easily end up with such a crash log. Please take a look at https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso – geisshirt Jun 11 '16 at 09:16
  • It's worth checking out [Relinker](https://github.com/KeepSafe/ReLinker) for loading native libs – EpicPandaForce Aug 05 '16 at 14:01

1 Answers1

2

I had the exact problem and following @geisshirt comment I included this on my app's gradle file to force realm to only use 32-bit dependencies.

packagingOptions {
    exclude "lib/arm64-v8a/librealm-jni.so"
}

More information can be obtained in https://realm.io/docs/java/latest/#couldnt-load-librealm-jniso