我想在我的cordova项目中添加以下依赖项。但是,构建过程中依赖项会被忽略。Android Gradle依赖关系
compile 'org.apache.httpcomponents:httpclient:4.5.2'
从类似问题的答案,我意识到我已经排除了几个模块和组。
所以我对依赖关系做了如下修改。
compile 'org.apache.httpcomponents:httpclient:4.5.2'
compile ('org.apache.httpcomponents:httpclient:4.5.2'){
exclude module: 'httpclient' //by artifact name
exclude group: 'org.apache.httpcomponents' //by group
exclude group: 'org.apache.httpcomponents', module: 'httpclient' //by both name and group
}
不过,我仍然得到此警告。
WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.2 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.
由于这样,我的所有HTTP命令,如HTTP POST,HTTP客户端等都没有解决。
有人可以建议我究竟要排除什么,以及是否需要更改配置?
确保你在正确的build.gradle文件中完成它。我在Google LVL上遇到了这个问题,但一直把它放在应用程序的build.gradle中 – Oded