繁体   English   中英

警告:依赖org.apache.httpcomponents:httpclient:4.0.1被忽略

[英]Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored

当我尝试将libs2文件夹中的任何.jar文件添加到libs文件夹中时 在此处输入图片说明

我收到以下错误:

    Information:Gradle tasks [:app:assembleDebug]
    Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
             In case of problem, please repackage it with jarjar to change the class packages
    Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
             In case of problem, please repackage it with jarjar to change the class packages
    :app:preBuild UP-TO-DATE
   .....
    :app:compileDebugNdk UP-TO-DATE
    :app:compileDebugSources
    :app:transformClassesWithDexForDebug
    UNEXPECTED TOP-LEVEL EXCEPTION:
    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2

我知道一个事实,那就是libs2中的文件会导致错误,因为基于此人的建议 ,我将一个一个地添加它们,然后查看哪个文件会导致问题。

我正在学习一个需要所有这些.jar文件的教程 ,因此我不明白为什么我得到这些错误,因为它们是必需的。

使用Gradle无需降级或查找另一个jar-因为可以按组/模块过滤:

compile ('com.google.http-client:google-http-client-jackson2:1.21.0') {
    exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}

在5.0及以上版本(api 23+)中,http客户端已被删除,甚至不存在降级您的maxsdk或使用url连接的情况,您应该找到与api23 +兼容的最新jar文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM