android - 由于 Android Studio 冲突而忽略了依赖项

标签 android gradle google-drive-android-api

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

依赖

 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
}

关于android - 由于 Android Studio 冲突而忽略了依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30460148/

相关文章:

Android:xml 图像缩放不足以增加图像大小

gradle - 使用 Flyway 恢复上次迁移

java - 如何正确创建 Gradle 任务?

android - 是否可以从 Android API 随机访问写入 Google Drive 文件?

android - 找不到 com.android.support :appcompat-v7:27. 1.1

Android 3.x+ Java ZipFile 类 - 无法从大文件中读取 ZipEntries

java - 如何使用 Google Drive Java Client Library 获取查询 Google Drive 的文件 ID

android - 使用 google drive API 访问我自己的 "public"文件夹 android/iOS

android - 为什么 Fragment 的 ScrollView 中的 LinearLayout 是 NULL 对象?

android - 使用 Gradle 在 IDEA 中设置项目