Robosodium icon indicating copy to clipboard operation
Robosodium copied to clipboard

64bit library?

Open luzianscherrer opened this issue 9 years ago • 4 comments

I'm using your package to integrate libkalium into an Android project and it is working great. But today I've tried to deploy to a Samsung Galaxy S6 and that gives me the following error:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.my.app-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libkaliumjni.so"

Is this a known issue?

luzianscherrer avatar Feb 18 '16 20:02 luzianscherrer

Actually I've just found a nice solution:

  1. Add android.useDeprecatedNdk=true to graddle.properties
  2. Edit build.gradle:
android {
    ...
    defaultConfig {
        ...
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }
}

luzianscherrer avatar Feb 19 '16 06:02 luzianscherrer

Hi,

Currently, the only platforms where libsodium is built are armeabi, armeabi-v7a, x86 and mips. That could be the reason why it's failing on Galaxy S6.

I'll try to add support to x64. Stay tuned please, probably I'll require some help in order to test if x64 is working.

Also, thank you for your "hotfix".

GerardSoleCa avatar Feb 19 '16 21:02 GerardSoleCa

Got a Nexus 5X with 64-bit ARMv8-A. I can test this too.

benhylau avatar Apr 24 '16 17:04 benhylau

Some additional resources as to why @luzianscherrer's workaround works:

  • https://corbt.com/posts/2015/09/18/mixing-32-and-64bit-dependencies-in-android.html
  • http://stackoverflow.com/questions/27186243/use-32-bit-jni-libraries-on-64-bit-android/27202958#27202958

Note also that libsodium 1.11 supports 64-bit Android, in case anyone's interested in authoring a PR :)

capnfabs avatar Oct 17 '16 08:10 capnfabs