In an Android Gradle build, how to exclude dependencies from an included jar file?
Exclude the Group in the dependencies by using the below lines.
1.
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
2.
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile ("com.xxx:xxx-commons:1.+") {
exclude group: 'junit', module: 'junit'
}
}
3.
configurations {
runtime.exclude group: "org.slf4j", module: "slf4j-log4j12"
}
Try this one.
For more detail