More than one file was found with OS independent path 'lib/armeabi-v7a/xxx.so'

问题描述,我这个so文件在第三方库中,主程序中找不到该so库,报如下错误。

Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
More than one file was found with OS independent path 'lib/armeabi-v7a/xxx.so'

我的解决办法,是,把整个so的文件夹放到主项目的libs下,并做响应的引用,例如

 defaultConfig {
 	...
	ndk {
            abiFilters "armeabi-v7a"
            // 设置支持的SO库架构
            abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
            abiFilters 'x86_64'
        }
        ...
 }
sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

重新运行一遍,可以通过

你可能感兴趣的:(Android基础)