owlcs / owlapi

OWL API main repository
813 stars 314 forks source link

Many duplicated dependencies on Android while importing owlapi-distribution #1133

Closed Redych-the-kid closed 2 months ago

Redych-the-kid commented 2 months ago

I get many duplicated dependencies while importing your library in Kotlin in Android Studio

ignazio1977 commented 2 months ago

Hi, can you add more details?

Redych-the-kid commented 2 months ago

I'm using 'implementation("net.sourceforge.owlapi:owlapi-distribution:4.5.7")'(higher versions doesn't work either) Output of Gradle is in the file gradle_out.txt

ignazio1977 commented 2 months ago

owlapi-distribution is an OSGi jar that includes all OWLAPI jars as dependencies packaged in the jar file. You can avoid these warnings by either excluding transitive dependencies on the net.sourceforge.owlapi group or by depending on owlapi-binding instead - that will leave out the OSGi packaging infrastructure.

These should just be warnings - the class definitions are identical.

Redych-the-kid commented 2 months ago

How can I do that?

Redych-the-kid commented 2 months ago

Fixed by switching to 4.5.6 and importing Google Guava. But now when trying to create manager, it crashes with java.lang.Error: java.lang.NoSuchFieldException: No field threadLocalRandomProbe in class Ljava/lang/Thread;

ignazio1977 commented 2 months ago

I recommend NOT going back to 4.5.6, it's years out of date.

4.7.0 is not an OWLAPI version, not sure where that's coming from. However, just switch owlapi-distribution to owlapi-apibinding should remove the duplication you're seeing.