android studio中遇到Duplicate files copied in APK META-INFTICE.txt

 Error:Execution failed for task ':eopen:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF TICE.txt
File1: E:\AndroidStudioProject\Open\eopen\libs\httpmime-4.1.2.jar

File2: E:\AndroidStudioProject\Open\eopen\libs\fastjson-1.1.33.jar 

项目运行遇到Duplicate files copied in APK META-INFTICE问题,解决办法:

在自己项目的mudoles里面的build.gradle添加

android {
    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'
    }
}

你可能感兴趣的:(android studio中遇到Duplicate files copied in APK META-INFTICE.txt)