Android gradle 使用 firebase 依赖项构建有警告(忽略 httpclient)

Android gradle build with firebase dependency has warnings (ignoring httpclient)

在我使用 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
    }

如果我没记错的话应该是

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

版本可以省略

我找到了删除警告的选项

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