简体   繁体   中英

Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored

When I try adding any of the the .jar files that are in my libs2 folder to my libs folder 在此处输入图片说明

I get the following error:

    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

I know for a fact that the files in libs2 cause the error since I would add them one by one and see which ones would cause a problem or not, based on this persons suggestion .

I am following a tutorial which requires all of those .jar files, so I do not understand why I am getting those errors since they are necessary.

with Gradle no need to downgrade or to find another jar - since one can filter per group/module:

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文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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