Closed byencho closed 6 years ago
Hey,
Can you check if adding this to your build.gradle
works for your project?
implementation 'org.jetbrains:annotations-java5:16.0.2'
implementation ('com.jakewharton.timber:timber:4.7.1') {
exclude group: 'org.jetbrains'
}
The plain Timber implementation worked fine for me in a Kotlin-only project (with no explicit targetCompatibility set to 1.8), but it could be probably because Kotlin might include the needed stuff for JetBrains Annotations. Just wanted to check if this method works with your project.
Thanks!
@dgadelha Thanks for the suggestion but that didn't seem to help. I should note that I'm using an older version of gradle so technically I used:
compile 'org.jetbrains:annotations-java5:16.0.2'
compile ('com.jakewharton.timber:timber:4.7.1') {
exclude group: 'org.jetbrains'
}
but that should be equivalent. I also tried other variations on forcing a different version of the annotations, such as
compile ('org.jetbrains:annotations:15.0') { force = true }
compile 'com.jakewharton.timber:timber:4.7.1'
Based on the output of gradlew dependencies
, that seemed to successfully override the dependency but I'm still getting the build error.
@byencho Sad to hear it didn't help. Looks like we'd need to wait for an update from @JakeWharton then.
Until a solution comes, I guess you can keep using the previous version of Timber.
Thanks!
confirmed here too :(
I don't think I'm going to "fix" this. With AS / AGP 3.2 desugar has moved into D8 and should just work. With AS / AGP 3.1 you can enable it by setting android.enableD8.desugaring=true
in gradle.properties
. The Android toolchain is long overdue in making Java 8 the default, and with 3.2 becoming stable it's finally time where libraries don't have to worry about it anymore.
OK, seems fair. Thanks for checking! I'll close this out.
We have a project that is currently not compatible with JDK 1.8. When updating from version 4.7.0 to 4.7.1 we get the following error:
This appears to be related to the version bump for the Jetbrains annotations (https://github.com/JakeWharton/timber/commit/28aa40af827686bb5d4b8c481d582e9e3a04a7f9#diff-c197962302397baf3a4cc36463dce5eaL29). The docs for the annotations starting with version 16.0.1 mention they require JDK 1.8:
This is first mentioned at https://github.com/JetBrains/java-annotations/commit/fda1bd27cac5b7964d64a5a2586a853460d301c2#diff-04c6e90faac2675aa89e2176d2eec7d8 .
Is JDK 1.8 meant to be an intentional dependency for Timber 4.7.1 and up?