简体   繁体   中英

Building a jar file from a gradle dependency

I need to make dex file from my android project. First, i need to compile my classes to jar. But i need dependencies in jar. otherwise, i'll get about 300 errors because of unknown methods. I need Timber in jar. but i can't find it in the internet. I searched a lot, but no luck. This is the link to the source code in github. https://github.com/JakeWharton/timber
How do i build a jar from this gradle project?

To add gradle library to your project, you need to add implementation "package-group:package-name:package-version" to your build.gradle.

For Timber, you would do implementation "com.jakewharton.timber:timber:4.7.1" .

If you want to compile your project, with its dependencies into a jar, then you want to look up "fat jars". Gradle Shadowjar is a plugin that does this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM