纪行:解决java.lang.UnsatisfiedLinkError: dlopen failed: library “XXX.so“ not found

Error message:

  java.lang.UnsatisfiedLinkError: dlopen failed: library "xxx.so" not found
  或者:
 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader
 [DexPathList[[zip file "/data/app/xxx-1/base.apk"],
 nativeLibraryDirectories=[/data/app/xxx/lib/arm, /data/app/xxx/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]]
  couldn't find "xxx.so"

指向
static {
System.loadLibrary(“xxx”);
}

Solution

Check that the build gradle of the compiled project supports several architectures

  ndk {
            abiFilters 'armeabi", "armeabi-v7a", "arm64-v8a'
        }

Then check the path of the build file of the ndk library as shown in the figure, corresponding to whether it contains the architecture pattern filled in above, check whether the directory contains the missing .so, if it is missing, copy it and compile it.

solve.Insert picture description here

If the current method can solve your problem, please like it and illuminate the direction for other coders.

Guess you like

Origin blog.csdn.net/qq_32931665/article/details/115243564