UnsatisfiedLinkError Couldn't Find "" With Visible In Aar File

- 1 answer

So I built an Android aar library which contains a native library ( Due to backward compatibility consideration, it's only built for armeabi and x86 architectures.

Now, I place the aar file and use it in my "client" app, I can clearly see the are under the aar's jni/armeabi and jni/x86 folders.

But the app crashes with this message:

java.lang.UnsatisfiedLinkError: ...
nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]] couldn't find ""

This looks like the client app isn't able to find the nativelib from aar. Any suggestions?



Actually in my case, due to the mentioned backward compatibility consideration, I need to put this in my library's build.gradle:

packagingOptions {
    exclude 'lib/armeabi-v7a/'
    exclude 'lib/x86_64/'

to guard the build away from the unwanted architectures.