My Android Advanced Tour------> Resolution: Execution failed for task ': App:transformresourceswithmergejavaresfordebug '.

Source: Internet
Author: User

Error description

Today, I added the Jackson development package to the Android Studio project, which caused the following error when compiling the runtime:

Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug‘.> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/NOTICE    File1: D:\Code\XTCKuwoWatch\app\libs\jackson-core-2.4.4.jar    File2: D:\Code\XTCKuwoWatch\app\libs\jackson-databind-2.4.4.jar

The error is as follows:

Solutions

Add the following code to the Build.gradle file

{        exclude ‘META-INF/LICENSE‘        exclude ‘META-INF/NOTICE‘    }
    • Build.gradle File not modified before
apply plugin:  ' com.android.application '  android { Compilesdkversion 22  buildtoolsversion  "22.0.1"  defaultconfig {applicationid  "com.oyp.csdn"  minsdkversion 16  targetsdkversion 23  versioncode 1  versionname " 1.0 "} buildtypes {release {min ifyenabled false  proguardfiles getdefaultproguardfile ( ' proguard-android.txt ' ),  ' Proguard-rules.pro ' }}}dependencies {C Ompile Filetree (dir :  ' Libs ' , include: [ ' *.jar ' ])} 
    • Modified Build.gradle File
Apply plugin:' Com.android.application 'Android {Compilesdkversion ABuildtoolsversion"22.0.1"packagingoptions {Exclude' Meta-inf/license 'Exclude' Meta-inf/notice '} defaultconfig {ApplicationID"COM.OYP.CSDN"Minsdkversion -Targetsdkversion atVersioncode1Versionname"1.0"} buildtypes {release {minifyenabledfalseProguardfiles Getdefaultproguardfile (' Proguard-android.txt '),' Proguard-rules.pro '}}}dependencies {Compile Filetree (dir:' Libs ', include: [' *.jar '])}
欧阳鹏 欢迎转载,与人分享是进步的源泉!转载请保留原文地址:http://blog.csdn.net/ouyang_peng

My Android Advanced Tour------> Resolution: Execution failed for task ': App:transformresourceswithmergejavaresfordebug '.

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.