Android Problem collection 48: Error:duplicate files during packaging of APK

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.