Dragon Boat Festival last day, heavy rain. Had to tinker with his favorite code at home.
In adding Dom4j.jar to the Fastjson test program, the compilation error is as follows:
Error:d uplicate files during packaging of apk/home/linc/workspace/lab/fastjsontestor/app/build/outputs/apk/ app-debug-unaligned.apk PathinchArchive:meta-inf/license.txt Origin1:/home/linc/workspace/lab/fastjsontestor/app/libs/fastjson-1.1.. Android.jar Origin2:/home/linc/workspace/lab/fastjsontestor/app/libs/dom4j-1.6. 1. jaryou can ignore those filesinchYour build.gradle:android {packagingoptions {exclude' Meta-inf/license.txt '} }Error: Execution failed forTask': App:packagedebug '.> Duplicate Files CopiedinchAPK Meta-inf/license.txt File1:/home/linc/workspace/lab/fastjsontestor/app/libs/fastjson-1.1.. Android.jar File2:/home/linc/workspace/lab/fastjsontestor/app/libs/dom4j-1.6. 1. jar
Originally LICENSE.txt appeared conflict, according to the hint, we just make some changes in the Build.gradle will LICENSE.txt out can be removed.
android { 19 "19.1.0" defaultConfig { "com.linc.fastjsontestor" 19 19 1 "1.0" } packagingOptions { ‘META-INF/NOTICE‘ ‘META-INF/LICENSE‘ ‘META-INF/LICENSE.txt‘ ‘META-INF/NOTICE.txt‘ } 。。。
Reference:
http://stackoverflow.com/questions/22467127/error-duplicate-files-during-packaging-of-apk
Android Problem collection 48: Error:duplicate files during packaging of APK