Scalified/viewmover

Multiple dex files define Lorg/slf4j/ILoggerFactory;

Closed this issue · 3 comments

With 1.1.0 I have this exception:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/slf4j/ILoggerFactory;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)

After looking at the dependencies I see:

+--- com.github.shell-software:viewmover:1.1.0
| +--- com.github.shell-software:uitools:1.1.0
| | --- org.slf4j:slf4j-api:1.7.9
| --- org.slf4j:slf4j-api:1.7.9

So I have to exclude slf4j from dependencies. Like this:
compile('com.github.shell-software:viewmover:1.1.0')
{
exclude group: 'org.slf4j', module: 'slf4j-api'
}

Hello mkovalyk,

Gradle is able to resolve such dependency conflicts, that is why slf4j has the compile scope.
Here are the examples of working configuration:

  1. Library
  2. Application, which depends on this library

As you can see there are many identical dependencies and build result is successful:
Build Status

For your case try the following:

  1. Check whether you have any local dependencies, which use slf4j library
  2. Update the Gradle binary and the Android Plugin for Gradle to the latest versions, try to compile.

Once done, let me know

Any updates upon this?

So far as you did not provide any additional information upon the recommended steps, the issue is considered to be as not reproducible and thus closed