0

Sorry for my English. I am new in android. How to export jar file using the android studio. I searched some code. Here the code:

task deleteJar(type: Delete) {
   delete 'release/libss.jar'
}

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

 createJar.dependsOn(deleteJar, build)

I will try that code but jar file not created in the specfic location only empty folder .

Its not work for me.......... Please help me.

  • Possible duplicate of [How to make a .jar out from an Android Studio project](https://stackoverflow.com/questions/21712714/how-to-make-a-jar-out-from-an-android-studio-project) – ayrusme Jun 30 '17 at 10:49
  • thanks.i will refer that link only.but it not working for me. – user8236797 Jun 30 '17 at 10:51
  • I think this is what you are looking for https://stackoverflow.com/a/35431416/4845438 – Daniel RL Jun 30 '17 at 11:13
  • thanks.yes that's correct. but when i put that code it does'nt create a jar file.simply empty folder in that location.please help me to solve my issue. – user8236797 Jun 30 '17 at 11:18

1 Answers1

0

First,Build, Select build variants and you can change the app's build variant. to release. Second, you might use like this code to gradl look the path "from" carefully. and set the path include 'classes.jar' Wish it could be help..