An error is reported when importing so files into the Android Library

Import the so file in the Android Library, and then import the module with the so file into the main module and report an error:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxxxx.xxxxxxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxxxx.xxxxxxx-1/lib/arm64, /data/app/com.xxxxx.xxxxxxx-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "xxxxx.so"

Later, it was found that the NDK configuration was only set in the library, and it was not added in the main module. Just add it in the main module build.gradle.

defaultConfig {
    
    
        
        xxxxxxxxxxxx
        xxxxxxxxxxxx

        ndk{
    
    
            abiFilters 'armeabi' ,'x86', 'armeabi-v7a', 'x86_64','mips'
        }
    }

Guess you like

Origin blog.csdn.net/qq_36224961/article/details/113395805