Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

It only happens on the ARM64 devices. I don't setup any custom NDK build in my gradle setting.

Looks like Android Studio somehow messing up the correct folder to copy the .so file.

How does the happen and how to fix it?

like image 326
shiami Avatar asked Dec 05 '25 07:12

shiami


1 Answers

Maybe you're using another library that does embed .so files for arm64-v8a? Open your APK as a zip file and look inside the lib folder to see if that's the case.

Then, to fix your issue, you can use abiFilters to include only .so files for the architectures you fully support:

android {
    ....
    defaultConfig {
        ....
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
}
like image 130
ph0b Avatar answered Dec 08 '25 18:12

ph0b



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!