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

Posted gali

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误:com.android.builder.packaging.DuplicateFileException: Duplicate files copied相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Informix 错误:发生了语法错误。错误代码:-201

我收到一个错误:“MetaMask - RPC 错误:错误:错误:[ethjs-rpc] rpc 错误与有效负载”

错误精灵错误跟踪器错误

网页打开显示错误500是啥意思

PHP错误处理

PHP的错误处理