Home » Android » Android multidex, UnsatisfiedLinkError – couldn't find .so file

Android multidex, UnsatisfiedLinkError – couldn't find .so file

Posted by: admin June 15, 2020 Leave a comment


i’m trying to add some lib (.jar & .so)to my multidex project in android studio.

when i add only a few jars to the project everything works fine.
in case i add more and more jars (other libs)
i’m getting this error:

  dalvik.system.PathClassLoader[DexPathList[[zip file
  /vendor/lib, /system/lib]]] couldn't find

any idea how can I tell to the compiler to generate jar and so in same dex?

How to&Answers:

If some of the extra JARs bring native libries for armeabi-v7a, while your libScanovatePassportAndIDLSDK_CPP.so was only built for armeabi, the installer will extract a wrong set of libraries. The fix is not to add more copies of .so, but rather strip away the other ABIs. In gradle, you can use splits.


There is an elegant solution for this. When your APK file doesn’t contain all native libs in 64bit version for a certain ABI you just need to make sure that your APK file does not contain any 64bit libs. Here is the tutorial on how to configure your project to fix this: https://corbt.com/posts/2015/09/18/mixing-32-and-64bit-dependencies-in-android.html

When your app is installed on 64bit ABI devices, package manager scans the APK file on install and looks for 64bit native libraries. If it finds the appropriate 64bit native library folder (you can check /libs folder in your APK file if you open it with any zip client) it assumes that all native libraries are available in 64bit versions. If one or more native libraries are not available in 64bit version, the package manager will fail to load their 32bit version. Hence, when the app attempts to run code that relies on these native librairies you will get this UnsatisfiedLinkError message. This means that the 32bit version of your library