[转]Android Studio 错误 Duplicate files copied in APK META-INF/LICENSE.txt

Duplicate files copied in APK META-INF/LICENSE.txt

android { packagingOptions { exclude 'META-INF/LICENSE.txt' }}

My logcat: log Execution failed for task ':Prog:packageDebug'.
Duplicate files copied in APK META-INF/LICENSE.txt File 1: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar File 2: /home/scijoker/AndroidStudioProjects/ProgProject/Prog/libs/httpclient-4.1.1.jar

解决方法:

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

推荐阅读更多精彩内容