[slf4j-dev] slf4j-api and slf4j-android don't play nicely together?

Thorsten Möller thorsten.moeller at unibas.ch
Mon Dec 9 17:24:25 CET 2013


Am 09.12.2013 um 06:51 schrieb <Carsten.Friedrich at csiro.au<mailto:Carsten.Friedrich at csiro.au>> <Carsten.Friedrich at csiro.au<mailto:Carsten.Friedrich at csiro.au>>:

I have a library which uses slf4j-api (through maven) and an Android App which uses the library and wants to use slf4j-android. Due to limitation of how maven integration works in Eclipse it seems I can only include all or none of the transitive dependencies of the library in my app. I want to chose all, as I need them (almost) all anyway. However, the classes in slf4j-api and alf4j-android overlap and they both contain copies of classes with identical names. The Android build process in Eclipse does not like this at all:

[2013-12-09 16:49:13 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/slf4j/ILoggerFactory;
[2013-12-09 16:49:13 - TSSAndroidColab] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/slf4j/ILoggerFactory;

Is there a way to use a generic base jar in a library and then some other system specific jars (e.g. for Android) in addition without duplicate class definitions?

You might want to check out the latest state in the Github repository [1] that does no longer bundles SLF4J’s API together with the Android logger binding (bundling both together in one JAR dates back to the early days of the Android platform where this was required). Even though the latest state is not „officially“ released, it can be considered stable and is on par with SLF4J 1.7.2.

HTH
Thorsten







Cheers,
Carsten

_______________________________________________
slf4j-dev mailing list
slf4j-dev at qos.ch<mailto:slf4j-dev at qos.ch>
http://mailman.qos.ch/mailman/listinfo/slf4j-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-dev/attachments/20131209/5bcc18d1/attachment.html>


More information about the slf4j-dev mailing list