Lumberjack icon indicating copy to clipboard operation
Lumberjack copied to clipboard

Not Compatible With Timber 5

Open rs-georg opened this issue 3 years ago • 3 comments

Lumberjack uses a hardcoded dependency on Timber 4.7.1 which is not backwards compatible with Timber 5.

rs-georg avatar Nov 16 '21 17:11 rs-georg

Timber 5 is binary compatible with 4.X according to Jake Wharton (https://github.com/JakeWharton/timber/releases/tag/5.0.0). As in any library, you can simply exclude the dependency from lumberjack and add your own timber version instead.

Also, feel free to fork and update the library and create a pull request - I probably will update it but don't know when yet...

MFlisar avatar Nov 17 '21 13:11 MFlisar

Thanks for your reply. Yes, you're right. That's what it states in the release notes. However, I couldn't get Lumberjack to work with Timber5 🤔 It's not a priority for now since we can continue using the previous version.

rs-georg avatar Jan 04 '22 14:01 rs-georg

I get the following error when I try to use Lumberjack with Timber 5.0.1

java.lang.NoSuchMethodError: No super method getTag()Ljava/lang/String; in class Ltimber/log/Timber$Tree; or its super classes (declaration of 'timber.log.Timber$Tree' appears in /data/data/<package-name>/code_cache/.overlay/base.apk/classes20.dex)

Looks like the tag is not public API anymore in Timber 5

@get:JvmSynthetic // Hide from public API. internal open val tag: String? get() { val tag = explicitTag.get() if (tag != null) { explicitTag.remove() } return tag }

mohit92 avatar Aug 15 '22 18:08 mohit92

I opened an issue here: https://github.com/JakeWharton/timber/issues/477

I don't think it will be changed because timber looks quite abandoned, but I think, updating to timber 5 is not that important as you get all kotlin features from lumberjack anyways and timber is just hidden internally...

So for now I'll close this issue.

Note

I could upgrade to timber v5, but this would mean I'd need to access the tag in Timber.Tree via reflection and I think its not worth that...

MFlisar avatar Oct 19 '22 13:10 MFlisar