Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Timber Logger on my java library?

I add the Timber dependency to my Java Core Library Module build.gradle file:

implementation 'com.jakewharton.timber:timber:4.6.0'

Although it did not give an error when gradle synchronizes, I cannot see or use Timber class in the Core Library.

like image 851
alexpfx Avatar asked Nov 05 '17 00:11

alexpfx


1 Answers

If anyone looking at Timber (Without android dependency) for mutli-module android project. Use timber-jdk like below.

In project's build.gradle file.

allprojects {
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }
}

In individual module build.gradle file (Example: Domain or remote module)

implementation "com.jakewharton.timber:timber-jdk:5.0.0-SNAPSHOT"

With this you should be able to implement Timber without android framework dependency

like image 113
Naveen T P Avatar answered Sep 29 '22 12:09

Naveen T P