Skip to content Skip to sidebar Skip to footer

Gradle: Multiple Dependences Require Slf4j

I have two libs in my gradle file that require slf4j. Pusher and Gimbal. Both of these jars have slf4j in them. So even when I tell gradle to ignore them (multiDexEnabled true) I s

Solution 1:

Multidex solves a very different problem from the one you describe. Multidex fixes the issue of being limited to ~65,000 methods per dex file. You can find the documentation for multidex here.

Instead, what you want to do is exclude sl4j from one of your libraries, here's an example of what that might look like, depending on what dependencies are causing the issue:

compile ('com.example.library:library-with-sl4j:1.0') {
    exclude group: 'org.sl4j', module: 'sl4j-simple'
}

You will have to identify which library is causing the issue and which sl4j module you need to exclude.

Ideally you would inform the library author(s) using older versions that they should update so that all your dependency are using the same (latest) version.

Post a Comment for "Gradle: Multiple Dependences Require Slf4j"