Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE.txt
File1: C:\Users\huangjie\StudioProjects\TestLean\app\libs\fastjson.jar
File2: C:\Users\huangjie\StudioProjects\TestLean\app\libs\httpmime-4.2.4.jar
意思是不同jar包间存在重复的文件,添加以下常见忽略配置于build.gradle
packagingOptions{
exclude’META-INF/DEPENDENCIES.txt’
exclude’META-INF/LICENSE.txt’
exclude’META-INF/NOTICE.txt’
exclude’META-INF/NOTICE’
exclude’META-INF/LICENSE’
exclude’META-INF/DEPENDENCIES’
exclude’META-INF/notice.txt’
exclude’META-INF/license.txt’
exclude’META-INF/dependencies.txt’
exclude’META-INF/LGPL2.1’
}