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

Still new Timber.DebugTree() cannot be coded in Java #484

Open
cyfung1031 opened this issue May 7, 2023 · 10 comments
Open

Still new Timber.DebugTree() cannot be coded in Java #484

cyfung1031 opened this issue May 7, 2023 · 10 comments

Comments

@cyfung1031
Copy link

cyfung1031 commented May 7, 2023

This issue occurs since 5.0.0.
No fixing in 5.0.1.

For Java version, we have to use 4.7.1.

#458 #459
https://stackoverflow.com/questions/70870740/cannot-resolve-method-planttimber-log-timber-debugtree

If this is unsolvable, please add remarks in README.me for new users to use it with Java code.

@CristianRobles12
Copy link

Is this library even updated anymore?

@cleanriceking
Copy link

This issue occurs since 5.0.0. No fixing in 5.0.1.

For Java version, we have to use 4.7.1.

#458 #459 https://stackoverflow.com/questions/70870740/cannot-resolve-method-planttimber-log-timber-debugtree

If this is unsolvable, please add remarks in README.me for new users to use it with Java code.

https://stackoverflow.com/questions/70870740/cannot-resolve-method-planttimber-log-timber-debugtree/75388643#75388643

@cyfung1031
Copy link
Author

This issue occurs since 5.0.0. No fixing in 5.0.1.
For Java version, we have to use 4.7.1.
#458 #459 https://stackoverflow.com/questions/70870740/cannot-resolve-method-planttimber-log-timber-debugtree
If this is unsolvable, please add remarks in README.me for new users to use it with Java code.

https://stackoverflow.com/questions/70870740/cannot-resolve-method-planttimber-log-timber-debugtree/75388643#75388643

This shit is not Java.

@iboalali
Copy link

iboalali commented Oct 1, 2023

If you have a mixed kotlin and java project, you could write a kotlin function to plant the trees. Call Timber#plant from your kotlin code, and call you own kotlin plant function from your java code

@bxter
Copy link

bxter commented Nov 14, 2023

same to me, i use in react-native android project.
why not fix it ???

@danielphan2003
Copy link

danielphan2003 commented Dec 8, 2023

For anyone who found other dependencies that use Timber 5.0+ (like https://github.com/maplibre/maplibre-native and https://github.com/maplibre/maplibre-plugins-android), you can exclude them in the gradle file (Kotlin DSL) of your app's module like this:

implementation(...) {
    exclude(group = "com.jakewharton.timber", module = "timber")
}

If not excluded, the code still compiles but your IDE will show this error as it won't know which one to use, so it goes with the later one instead.

See the tips in https://github.com/AndroidKnife/RxBus#usage for the old gradle DSL usage.

@dimaslanjaka
Copy link

image

same here

@moneeWong
Copy link

暂时使用反射来避免红线错误
Class<?> clazz = Timber.DebugTree.class;
Timber.Tree tree;
try {
tree = (Timber.Tree) clazz.newInstance();
} catch (IllegalAccessException | InstantiationException e) {
throw new RuntimeException(e);
}
Timber.plant(tree);

@dimaslanjaka
Copy link

try this guys

Timber.plant(Timber.asTree());

@alexanderankin
Copy link

this_is_fine.jpg

// noinspection DataFlowIssue
Timber.plant((Timber.Tree) (Object) new Timber.DebugTree());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants