简体   繁体   English

格子-android-httpclient库版本不匹配

[英]plaid - android - httpclient library version mismatch

I am using plaid-java:0.2.10 as a dependency in my Android app. 我在我的Android应用程序中使用plaid-java:0.2.10作为依赖项。

Plaid uses org.apache.httpcomponents:httpclient:4.4.1 as a dependency. 格子使用org.apache.httpcomponents:httpclient:4.4.1作为依赖项。 And, android also includes the same library as a dependency. 并且,android还包括与依赖项相同的库。

However, there is a mismatch in their versions. 但是,它们的版本不匹配。 I get the following error when i build using gradle, 使用gradle构建时出现以下错误,

Dependency org.apache.httpcomponents:httpclient:4.3.3 is ignored for debug as it may be conflicting with the internal version provided by Android. 依赖项org.apache.httpcomponents:httpclient:4.3.3在调试时将被忽略,因为它可能与Android提供的内部版本冲突。

I want to use the one provided by plaid. 我想使用格子布提供的那种。

How do i get this to work? 我该如何工作? Is there a way to ignore the library provided by android? 有没有办法忽略android提供的库?

Question - is it not possible to ignore the apachehttpclient library provided by google and use a newer version of the library instead? 问题-是否无法忽略google提供的apachehttpclient库,而是使用该库的较新版本?

It is not. 它不是。 The Apache HttpClient Android Port can deployed along-side with the old version shipped with the platform. Apache HttpClient Android Port可以与平台附带的旧版本一起部署。

Why isnt this possible? 为什么这不可能呢?

It is believed to be for security reasons. 据认为是出于安全原因。

ok, so i found this at the Apache website, 好的,所以我在Apache网站上找到了这个

Google Android 1.0 was released with a pre-BETA snapshot of Apache HttpClient. Google Android 1.0发行时带有Apache HttpClient的预测试版快照。 To coincide with the first Android release Apache HttpClient 4.0 APIs had to be frozen prematurely, while many of interfaces and internal structures were still not fully worked out. 为了与第一个Android版本一致,Apache HttpClient 4.0 API必须过早冻结,而许多接口和内部结构仍未完全解决。 As Apache HttpClient 4.0 was maturing the project was expecting Google to incorporate the latest code improvements into their code tree. 随着Apache HttpClient 4.0的日趋成熟,该项目期望Google将最新的代码改进纳入其代码树中。 Unfortunately it did not happen. 不幸的是它没有发生。 Version of Apache HttpClient shipped with Android has effectively become a fork. Android随附的Apache HttpClient版本实际上已成为分支。 Eventually Google decided to discontinue further development of their fork while refusing to upgrade to the stock version of Apache HttpClient citing compatibility concerns as a reason for such decision. 最终,由于兼容性方面的考虑,Google决定停止对fork的进一步开发,同时拒绝升级到Apache HttpClient的现有版本。 As a result those Android developers who would like to continue using Apache HttpClient APIs on Android cannot take advantage of newer features, performance improvements and bug fixes. 结果,那些想继续在Android上使用Apache HttpClient API的Android开发人员无法利用更新的功能,性能改进和错误修复。

Question - is it not possible to ignore the apachehttpclient library provided by google and use a newer version of the library instead? 问题-是否无法忽略google提供的apachehttpclient库,而是使用该库的较新版本? Why isnt this possible? 为什么这不可能呢?

You need to give the below code snippet in the dependencies section in the build.gradle file of you app module. 您需要在应用程序模块的build.gradle文件的“依赖关系”部分中提供以下代码段。

  configurations {
        compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
    }

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

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