Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing transitive dependency on slf4j-api-2.x #359

Open
3 tasks done
xdevl opened this issue Aug 26, 2023 · 0 comments
Open
3 tasks done

Missing transitive dependency on slf4j-api-2.x #359

xdevl opened this issue Aug 26, 2023 · 0 comments
Assignees

Comments

@xdevl
Copy link

xdevl commented Aug 26, 2023

Describe the bug

Depending on a lib that depends on slf4j-api-1.x causes the following crash:

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.slf4j.spi.SLF4JServiceProvider" on path: DexPathList[...]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388) 

logback-android should therefore declare a transitive dependency on slf4j-api-2.x in the same way it is done in slf4j-nop for example:

$ gradlew dependencies
...
+--- com.github.tony19:logback-android:2.0.1
+--- org.slf4j:slf4j-nop:3.0.0
 |    \--- org.slf4j:slf4j-api:2.0.7
...

Reproduction

With a Gradle project depending on logback-android run ./gradlew dependencies and observe the tree

Logs

No response

logback-android version

3.0.0

OS Version

11

What logback configuration are you using? (logback.xml or Java/Kotlin code)

Kotlin code

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants