Reprint please indicate the source:
Http://www.cnblogs.com/why168888/p/5978381.html
This article is from:"Edwin Blog Garden"
I quoted compile ' com.squareup.retrofit2:converter-jackson:2.1.0 ' gradle without errors, running the app on this error.
error log :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/license
Here's how to fix it:
Android {compilesdkversion -buildtoolsversion"24.0.3"Defaultconfig {ApplicationID"com.edwin.xxxx"minsdkversion +targetsdkversion -Versioncode1Versionname"1.0"Testinstrumentationrunner"Android.support.test.runner.AndroidJUnitRunner"} buildtypes {release {minifyenabledfalseproguardfiles Getdefaultproguardfile ('Proguard-android.txt'),'Proguard-rules.pro' } }packagingoptions{Exclude'Meta-inf/notice' //Would not include NOTICE fileExclude'Meta-inf/license' //Would not include LICENSE file//As noted by @Vishnuvathsan the also need to include//Variations on the file name. It depends on your dependencies. //Some Other common variations on notice and license file namesExclude'Meta-inf/notice'Exclude'Meta-inf/notice.txt'Exclude'Meta-inf/license'Exclude'Meta-inf/license.txt' }}
Android Studio Run appears error:execution failed for task ': App:transformresourceswithmergejavaresfordebug '.