android new file 产生重复文件 ~2,Android Gradle在打包httpmime期间生成重复文件

当我尝试构建我的android项目时出现此错误.首先,我收到一个错误,由于AndroidMultiPartEntity.java中的问题,我无法运行东西,所以我添加了

compile "org.apache.httpcomponents:httpmime:4.2.3"

在依赖中.许多错误消失了,但是出现了该错误.

Information:Gradle tasks [:app:assembleDebug]

Error:duplicate files during packaging of APK C:\Users\AkerbergE\AndroidStudioProjects\incident\app\build\outputs\apk\app-debug-unaligned.apk

Path in archive: META-INF/NOTICE.txt

Origin 1: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpmime\4.2.3\118ae1bc7f3aeeddfe564f0edfd79c11d09d17d1\httpmime-4.2.3.jar

Origin 2: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.2.2\b76bee23cd3f3ee9b98bc7c2c14670e821ddbbfd\httpcore-4.2.2.jar

You can ignore those files in your build.gradle:

android {

packagingOptions {

exclude 'META-INF/NOTICE.txt'

}

}

Error:Execution failed for task ':app:packageDebug'.

> Duplicate files copied in APK META-INF/NOTICE.txt

File 1: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpmime\4.2.3\118ae1bc7f3aeeddfe564f0edfd79c11d09d17d1\httpmime-4.2.3.jar

File 2: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore\4.2.2\b76bee23cd3f3ee9b98bc7c2c14670e821ddbbfd\httpcore-4.2.2.jar

Information:BUILD FAILED

Information:Total time: 3.903 secs

Information:2 errors

Information:0 warnings

Information:See complete output in console

我的build.gradle

apply plugin: 'com.android.application'

android {

compileSdkVersion 21

buildToolsVersion "21.1.2"

packagingOptions {

exclude 'META-INF/notice.txt'

exclude 'META-INF/NOTICE.TXT'

}

defaultConfig {

applicationId "com.example.akerberge.incident"

minSdkVersion 15

targetSdkVersion 21

versionCode 1

versionName "1.0"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile 'com.android.support:appcompat-v7:22.2.0'

compile "org.apache.httpcomponents:httpmime:4.2.3"

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值