In my Android app, I\'m getting a java.lang.NoClassDefFoundError when the code that references code in a dependent .jar is executed. My project includes an Andr
This is not directly possible as local jars are not declared as transitive dependencies in Gradle.
You have two options:
The second option gives you the ability to have more than one project depend directly on the local jar (on top of it becoming a transitive dependency). To do it, create a new gradle project and just put in its build.gradle the following:
configurations.create("default")
artifacts.add("default", file('somelib.jar'))
This simply register your jar as the default artifact published by the project and this will get consumed by the other projects.