当我尝试构建我的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.2.38ae1bc7f3aeeddfe564f0edfd79c11d09d17d1\httpmime-4.2.3.jar Origin 2: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore.2.2\b76bee23cd3f3ee9b98bc7c2c14670e821ddbbfd\httpcore-4.2.2.jarYou 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.2.38ae1bc7f3aeeddfe564f0edfd79c11d09d17d1\httpmime-4.2.3.jar file 2: C:\Users\AkerbergE\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpcore.2.2\b76bee23cd3f3ee9b98bc7c2c14670e821ddbbfd\httpcore-4.2.2.jarinformation:BUILD Failedinformation:Total time: 3.903 secsinformation:2 errorsinformation:0 warningsinformation: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"}
解决方法:
实际上在您编写的代码中
排除“ meta-inf / NOTICE.TXT”
而不是这样写:
排除“ meta-inf / NOTICE.txt”
因此,您的build.gradle文件如下所示:
apply plugin: 'com.androID.application'androID { compileSdkVersion 21 buildToolsversion "21.1.2" defaultConfig { applicationID "com.example.akerberge.incIDent" minSdkVersion 15 targetSdkVersion 21 versionCode 1 versionname "1.0" packagingOptions { exclude 'meta-inf/notice.txt' exclude 'meta-inf/NOTICE.txt' exclude 'meta-inf/liCENSE.txt' } } 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"}
总结 以上是内存溢出为你收集整理的Android Gradle在打包httpmime期间生成重复文件全部内容,希望文章能够帮你解决Android Gradle在打包httpmime期间生成重复文件所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)