I get a lot of these warnings when building my project with gradle. I see https://stackoverflow.com/a/15794650/864069, but I\'m unclear how to silence these. It sounds like
I'm unsure if this can create issues. The best thing to do is to follow the suggestion in the warning, or exclude the dependency entirely (your point #2, which I've answered below).
I've been seeing these warnings as well, specifically the 'commons-logging' one.
What the answer in the thread you linked too is saying is that you should ignore these dependencies since the Android APIs include them already (I think. Correct me if I'm wrong).
For example if you are specifically requiring commons-logging (or another that gives a similar warning) remove it from your list.
build.gradle file:
dependencies {
...
compile 'commons-logging:commons-logging:1.1.3' #Remove this line; you don't need it.
....
}
Also, if you have a dependency that requires commons-logging as a transitive dependency, you should exclude it as well.
Example:
dependencies {
...
compile 'some.package.that:requires_commons_logging:1.2.3'
....
}
becomes
dependencies {
...
compile ('some.package.that:requires_commons_logging:1.2.3') {
exclude group: 'commons-logging', module: 'commons-logging'
}
....
}
An easy way to completely exclude it can be done by adding this to your build.gradle file as well, without having to exclude it in each dependency:
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}
Finally, to view the dependency tree (and to see what each of your dependencies transitively import on their own which can conflict, which can be very useful), use this command from the root of your project:
./gradlew :your_module_name:dependencies
If you want to silent the warnings, you have to add this in your build.gradle for each dependency :
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
It will be :
dependencies {
...
compile ('some.package.that:requires_commons_logging:1.2.3') {
exclude group: 'commons-logging', module: 'commons-logging'
}
....
}