UnsatisfiedLinkError nativeLibraryDirectories = [/ vendor / lib64, / system / lib64

The situation is as follows:

I have a 64-bit apk that needs to have a 32-bit shared object (.so file) from /system/lib

. But apk crashes on startup and says:

UnsatisfiedLinkError nativeLibraryDirectories=[/vendor/lib64, /system/lib64

      

I think it is trying to find my .so file which is /system/lib

from / system / lib 64, then an error occurs.

How can I search from /system/lib

instead /system/lib64

?

+3


source to share


2 answers


This is because you are linking at least one 64-bit source library. Android detects this and decides to find the rest of the .so files in 64-bit locations. It doesn't find them because you only build 32-bit architectures.

To see if this is your problem, open the built-in apk and look in the lib directory. Each subdirectory in it represents an internal binary architecture. Unless you create all your own .so files for this architecture, the directory should not be there. Find out why it is and stop it.



One example of this is Crashlytics, which can safely tie itself. The resulting crash only appears on 64-bit devices, because 32-bit devices never look for 64-bit architecture directories.

You need to prune architectures that you do not fully support from your third party middleware.

+4


source


If you only have x86 and armeabi-v7a libraries, your application should be automatically installed in "32-bit mode".

Try using this in your gradle file:



android {.... defaultConfig {.... ndk {abiFilters "armeabi-v7a", "x86"}}}

+3


source







All Articles