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

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

錯誤描述:json

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

Execution failed for task ':XXXX:packageDebug'.ui

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

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

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

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.jarast

解決方法:

在build.gradle的android節點添加file

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

相關文章
相關標籤/搜索