Appstute Appstute - 2 years ago 116
Android Question

.jar file not generating in android studio

I'm working project which requires another project's .jar file.
I'm using android studio 2.3.3.
Following is code to generate .jar file

task clearJar(type: Delete) {
delete 'build/outputs/NAME.jar'}

task makeJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('build/outputs/')
include('classes.jar')
rename ('classes.jar', 'NAME.jar')}

makeJar.dependsOn(clearJar, build)


When i compile a project and call makeJar it executes successful, but I'm unable to find NAME.jar at desired location.
.aar file is generated, but i want .jar file.
Please help me to find a way.

Answer Source

I was facing the same problem earlier, I resolved it by clearing invalidated cache and restart studio.

Go to file -> Invalidate caches and restart. It will take time.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download