project.afterEvaluate{ // 打包的时候删除SO库 tasks.getByName('compileReleaseJavaWithJavac') { it.doLast { // 匹配armv7a, arm64v8a的,其它的SO库删除 def rootPath = rootProject.getRootDir().getAbsolutePath() + '/youProjectName/build/intermediates/library_and_local_jars_jni/release/jni/' if (abi == "armv7a") { delete fileTree(dir: rootPath + "/x86_64/", excludes: ['**/armeabi/**', '**/x86/**']) delete fileTree(dir: rootPath + "/arm64-v8a/", excludes: ['**/armeabi/**', '**/x86/**']) } else if (abi == "arm64v8a") { delete fileTree(dir: rootPath + "/x86/", excludes: ['**/armeabi/**', '**/x86/**']) delete fileTree(dir: rootPath + "/armeabi-v7a/", excludes: ['**/armeabi/**', '**/x86/**']) } } } }
打包aar的过滤中分平台过滤so
最新推荐文章于 2023-12-10 20:51:24 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)