错误:任务执行失败

时间:2016-04-30 19:29:20

标签: android-studio

错误:任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败。

  

com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:在APK META-INF / NOTICE中复制的重复文件       File1:C:\ Users \ ELA_HIDRI \ AndroidStudioProjects \ MyApplication3 \ httpclient-4.5.1 \ _ httpclient-4.5.1.jar       File2:C:\ Users \ ELA_HIDRI \ AndroidStudioProjects \ MyApplication3 \ httpcore-4.0-beta1 \ httpcore-4.0-beta1.jar

我上传了那些图书馆,当我将android studio上传到新版本时,他们使用完美的工作,它给了我这个错误

1 个答案:

答案 0 :(得分:3)

将此添加到您的gradle文件(app)

android {
 packagingOptions {
  exclude 'META-INF/DEPENDENCIES.txt'
  exclude 'META-INF/LICENSE.txt'
  exclude 'META-INF/NOTICE.txt'
  exclude 'META-INF/NOTICE'
  exclude 'META-INF/LICENSE'
  exclude 'META-INF/DEPENDENCIES'
  exclude 'META-INF/notice.txt'
  exclude 'META-INF/license.txt'
  exclude 'META-INF/dependencies.txt'
  exclude 'META-INF/LGPL2.1'
 }
}