【问题标题】:Android gradle build with firebase dependency has warnings (ignoring httpclient)具有 Firebase 依赖项的 Android gradle 构建有警告(忽略 httpclient)
【发布时间】:2015-03-08 17:51:00
【问题描述】:

在我使用 firebase 的 Android 项目中,gradle 构建会显示这个恼人的警告:

WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for devDebug 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.firebase:firebase-client-android:2.2.1') {
        exclude module: 'org.apache.httpcomponents:httpclient:4.0.1'   //IGNORED
    }

我也尝试删除建议的版本,但警告仍然存在

compile ('com.firebase:firebase-client-android:2.2.1') {
        exclude group:'org.apache.httpcomponents', module: 'httpclient'  //SAME
    }

【问题讨论】:

  • 一定要接受其中一个答案,以便将来帮助他人。我知道您需要等待一段时间。

标签: java android gradle firebase


【解决方案1】:

我找到了删除警告的选项

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

【讨论】:

    【解决方案2】:

    如果我没记错的话应该是

    compile ('com.firebase:firebase-client-android:2.2.1') {
            exclude group:'org.apache.httpcomponents', module: 'httpclient'  
    }
    

    版本可以省略。

    【讨论】:

    • 它看起来与其他接受的答案相同,但使用其他语法删除了警告
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 2021-03-12
    • 2015-12-20
    • 2017-07-07
    • 2018-01-02
    相关资源
    最近更新 更多