Can not find .so file on 64 bit android device

Umesh Aawte picture Umesh Aawte · Nov 25, 2015 · Viewed 10.2k times · Source

Using aviary android sdk using android studio and gradle build. App generated running fine on all devices having 32 bit architecture.

Same app is giving following error in the 64 bit device [Eg. Sony C4]

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

gredle.build part

dependencies {
    ...
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.facebook.fresco:fresco:0.8.1+'
    compile 'com.facebook.fresco:imagepipeline-okhttp:0.8.1+'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.adobe.creativesdk:image:4.0.0'
}

Reference That did not worked

Can't find ARM64 NDK native lib using Android Studio (1.3 RC)

Same error if use any of solution used.

How to use 32-bit native libraries on 64-bit Android device

Getting error like

Error:(16, 0) Error: NDK integration is deprecated in the current plugin.  Consider trying the new experimental plugin.  For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental.  Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration.

I am not sure what wrong I am doing or it is not supported at all.

Answer

Alex Cohn picture Alex Cohn · Nov 26, 2015

It looks like some of the packages you use come with 64-bit libraries, but some don't. To keep your APK 32-bit only, I use

android {
    splits {
        abi {
            enable true
            reset()
            include 'armeabi-v7a'
        }
    }
}

You can play with include 'armeabi' too, if it is relevant.