由于冲突 Android studio,依赖被忽略
Dependency ignored because of conflict Android studio
我正在尝试添加以下依赖项,但它被忽略了。我不明白如何解决它请帮助我谢谢。
依赖关系
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
您可以在模块的 build.gradle 文件中排除依赖项。
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
}
使用以下代码从 google API 库中排除冲突模块。
compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0' {
exclude module: 'httpcore'
exclude module: 'httpclient'
}
从所有配置中排除模块 httpclient。在 build.gradle 文件中添加此代码:
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
我正在尝试添加以下依赖项,但它被忽略了。我不明白如何解决它请帮助我谢谢。
依赖关系
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
您可以在模块的 build.gradle 文件中排除依赖项。
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
}
使用以下代码从 google API 库中排除冲突模块。
compile 'com.google.apis:google-api-services-drive:v2-rev170-1.20.0' {
exclude module: 'httpcore'
exclude module: 'httpclient'
}
从所有配置中排除模块 httpclient。在 build.gradle 文件中添加此代码:
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}