how to create a jar file from android studio
I found a way to achieve this, plain simple, using Gradle 2.2.1:
task jar(type: Jar, dependsOn: 'assembleRelease') {
from fileTree(dir: 'build/intermediates/classes/release')
}
Place this in your library module.
It will compile it as release and produce a JAR file in: build/libs
.
bash gradlew jar
or use your IDE to target that jar
Gradle task.