错误(com.android.builder.packaging.DuplicateFileException: Duplicate files copied)
出门莫恨无人随,书中车马多如簇。这篇文章主要讲述错误: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)】
推荐阅读
- Android 系统启动过程简单记录
- Android 中的长度单位pxdpsp
- 利用Dapper ORM搭建三层架构
- 安卓Android Support Design Library——Snackbar
- Window下搭建foundation apps环境
- cordova+vueCordova的环境搭建(android),真机测试
- Android开发学习——ButterKnife使用
- macs安卓工程创建
- Android中图片旋转