gpt4 book ai didi

java - 标记为重复的 HttpClient 依赖项

转载 作者:可可西里 更新时间:2023-11-01 16:28:07 25 4
gpt4 key购买 nike

当我运行 Android studio 项目时,我得到以下 gradle 输出:

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/NOTICE
File1: C:\Users\Benas\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpclient-android\4.3.5.1\eecbb0b998e77629862a13d957d552b3be58fc4e\httpclient-android-4.3.5.1.jar
File2: C:\Users\Benas\.gradle\caches\modules-2\files-2.1\org.apache.httpcomponents\httpmime\4.3\5b0002c5fb66867ca919be0fbd86de1cfaf76da7\httpmime-4.3.jar

我的build.gradle:

compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient-4.3.jar"
}

如何解决重复输入问题?

最佳答案

对于重复的 Meta-Inf 内容,您所要做的就是将其添加到您的 gradle 中

packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
}

关于java - 标记为重复的 HttpClient 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37328007/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com