AndroidStudio使用第三方jar包报错(Error: duplicate files during packaging of APK)

http://www.kwstu.com/ArticleView/android_201410252131196692

错误描述:

Error: duplicate files during packaging of APK D:\work\workspace\XXXX\build\apk\XXX-debug-unaligned.apk

Execution failed for task ':XXXX:packageDebug'.

> Duplicate files copied in APK META-INF/LICENSE.txt
File 1: D:\work\workspace\ADControl\libs\fastjson-1.1.32.jar

File 2: D:\work\workspace\ADControl\libs\fastjson-1.1.32.jar

Error:: duplicate files during packaging of APK D:\work\workspace\XXX\build\apk\XXX-debug-unaligned.apk

Execution failed for task ':ADControl:packageDebug'.
> Duplicate files copied in APK META-INF/NOTICE.txt
File 1: D:\work\workspace\ADControl\libs\fastjson-1.1.32.jar
File 2: D:\work\workspace\ADControl\libs\fastjson-1.1.32.jar

解决方法:

在build.gradle的android节点添加

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

 

分类: android solve


本文转自wanqi博客园博客,原文链接:http://www.cnblogs.com/wanqieddy/p/4775483.html,如需转载请自行联系原作者

上一篇:Jmeter压测过程报错the target server failed to respond


下一篇:[DevExpress]设置RepositoryItemComboBox只可下拉选择不可编辑