刚开始报错
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
加上代码 在android节点添加下
packagingOptions {
exclude 'META-INF/LICENSE'
}
后来报错
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/proguard/androidx-annotations.pro
继续添加报错信息
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
本文详细记录了解决Android项目构建过程中出现的APK重复文件错误的过程,包括如何排除META-INF目录下的LICENSE和proguard/androidx-annotations.pro文件,通过在build.gradle中添加特定的packagingOptions配置来避免构建失败。
3万+

被折叠的 条评论
为什么被折叠?



