码迷,mamicode.com
首页 > 移动开发 > 详细

错误:com.android.builder.packaging.DuplicateFileException: Duplicate files copied

时间:2017-08-23 18:17:40      阅读:443      评论:0      收藏:0      [点我收藏+]

标签:int   cache   smd   robot   sans   code   group   tree   inf   

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/README.md <!-- 这里提示的是相同文件冲突的名称--> File1: D:\CooKara\cookaraclient\app\libs\youtubevget.jar File2: C:\Users\guoxw\.gradle\caches\modules-2\files-2.1\org.jsoup\jsoup\1.10.3\b842f960942503cf1abbcc8c173a7f2c19d43726\jsoup-1.10.3.jar

1.加入jar包,多个jar包有相同文件产生的问题。

2.解决方法: buile.gradle

apply plugin: ‘com.android.application‘
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
 
<!-- 添加的解决方法 --> packagingOptions { exclude ‘META-INF/README.md‘ // 该处是上面错误异常提示的文件名 exclude ‘META-INF/CHANGES‘ }

defaultConfig { applicationId "com.multak.cookaraclient" minSdkVersion 16 targetSdkVersion 25 versionCode 20 versionName "2.21" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard-android.txt‘), ‘proguard-rules.pro‘ } } sourceSets { main { jniLibs.srcDirs = [‘libs‘] } } } dependencies { compile fileTree(include: [‘*.jar‘], dir: ‘libs‘) androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2‘, { exclude group: ‘com.android.support‘, module: ‘support-annotations‘ }) compile project(‘:Ripplelibrary‘) // // compile ‘com.android.support:appcompat-v7:25.3.1‘ compile ‘com.android.support.constraint:constraint-layout:1.0.2‘ compile ‘com.android.support:design:25.3.1‘ compile ‘com.android.support:support-v4:25.3.1‘ compile ‘org.greenrobot:eventbus:3.0.0‘ compile ‘com.larswerkman:HoloColorPicker:1.5‘ compile ‘com.nightonke:boommenu:2.1.0‘ compile ‘com.android.support:palette-v7:25.3.1‘ compile ‘com.dingmouren.paletteimageview:paletteimageview:1.0.6‘ compile ‘com.github.devlight.shadowlayout:library:1.0.2‘ compile ‘com.sdsmdg.harjot:croller:1.0.2‘ testCompile ‘junit:junit:4.12‘ compile files(‘libs/picasso-2.5.2.jar‘) compile files(‘libs/xstream-1.4.7.jar‘) compile files(‘libs/jackson-databind-2.1.5.jar‘) compile files(‘libs/youtubevget.jar‘) }

  

 

错误:com.android.builder.packaging.DuplicateFileException: Duplicate files copied

标签:int   cache   smd   robot   sans   code   group   tree   inf   

原文地址:http://www.cnblogs.com/galibujianbusana/p/7419438.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!