Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve method 'plant(timber.log.Timber.DebugTree)'

What is wrong with my configuration or code ?
I have this error highlighted

Cannot resolve method 'plant(timber.log.Timber.DebugTree)'

for the code

import timber.log.Timber;  
public class AppClass extends Application {  
    @Override  
    public void onCreate() {  
        super.onCreate();  
        if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); }  
    }  
}  

but it builds and it executes. Still I think it means something, no ?

Configuration infos:

Android Studio Bumblebee | 2021.1.1  
classpath 'com.android.tools.build:gradle:7.1.0'  
Gradle: com.jakewharton.timber:timber:5.0.1@aar  
ext.kotlin_version = '1.6.10'   
sourceCompatibility JavaVersion.VERSION_1_8
like image 733
C.B. Avatar asked Dec 12 '25 09:12

C.B.


1 Answers

Until issue fixed (as @n8yn8 noted in question comment) I solved it with downgrade to version 4.7.1:

implementation 'com.jakewharton.timber:timber:4.7.1'

There are some further discussions on Timber's GitHub Issue #459. It seems to be an issue related to IDE. It is confirmed that no solution with Timber 5+ for pure Java code at this moment.

like image 74
Solata Avatar answered Dec 14 '25 06:12

Solata