Android Studio UnsatisfiedLinkError error

When the error message is: the Java. Lang. UnsatisfiedLinkError: Dalvik. System. PathClassLoader [DexPathList [[zip file]]] couldn ‘t find “XXX. So,” because of the so file loading exception.

1. Check whether you forget to copy the corresponding SO file to the corresponding JNI directory.

2. Check the CPU architecture of the phone and check whether there are corresponding SO files (32-bit and 64-bit) in the corresponding JNI directory.

Solutions:

1. Copy the corresponding SO file to the corresponding JNI directory.

2. Generally speaking, phones with 64-bit architecture are compatible with running 32-bit SO files, that is, armeabi armeabi-v7A files are usually guaranteed.

If you only have the armeabi-V7 so file, but the architecture of the phone is not part of that architecture, you can set this in the project (most of the reasons for errors).

defaultConfig {
ndk {
         abiFilters"armeabi-v7a"// Specify compatible architectures for NDK (so that other dependencies such as MIPS,x86, Armeabi, ARM-V8 and so are filtered out)}}Copy the code

————————————————————————————————

If an error message appears:

NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin

Add android.useDeprecatedNdk=true to the gradle.properties file in the root directory of the project.