I am getting a DEX error (already added classes..) since mina is depending on slf4j-api, and slf4j-android is also carrying some of the slf4j-api internally. Is there a way to solve this while still using gradle external (maven based) dependencies?

dependencies {
    compile('org.apache.mina:mina-core:2.0.7')
    compile 'org.slf4j:slf4j-android:1.6.1-RC1'
}
有帮助吗?

解决方案

The answer seems to be the ability to exclude a module (sub-dependency):

dependencies {
    compile('org.apache.mina:mina-core:2.0.7') {
        exclude module: 'slf4j-api'
    }
    compile 'org.slf4j:slf4j-android:1.6.1-RC1'
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top