由于 Android Studio 冲突,依赖被忽略 [英] Dependency ignored because of conflict Android studio

查看:36
本文介绍了由于 Android Studio 冲突,依赖被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加以下依赖项,但它被忽略了.我不明白如何解决它请帮助我谢谢.

依赖

 编译 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0'

<块引用>

警告忽略依赖
警告:依赖 org.apache.httpcomponents:httpclient:4.0.1 在调试时被忽略,因为它可能与内部版本冲突安卓提供.有问题请用jarjar重新打包更改类包Warning:Dependencyorg.apache.httpcomponents:httpclient:4.0.1 被忽略发布为它可能与Android提供的内部版本冲突.有问题请用jarjar重新打包换类包

解决方案

您可以在模块的 build.gradle 文件中排除依赖项.

compile('com.google.apis:google-api-services-drive:v2-rev170-1.20.0') {排除模块:'httpclient'//按工件名称排除组:'org.apache.httpcomponents'//按组排除组:'org.apache.httpcomponents',模块:'httpclient'//通过名称和组}

I'm trying to add the following dependency but it is ignore. I can't understand how to resolve it please help me Thank you.

Dependency

 compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0'

Waring for ignoring dependency
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

解决方案

You can exclude dependencies in the build.gradle file of your module.

compile('com.google.apis:google-api-services-drive:v2-rev170-1.20.0') {
    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
}

这篇关于由于 Android Studio 冲突,依赖被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆