I recently upgraded my Android Studio to version 2.3 with the corresponding gradle version.
I have two modules inside my project, which i exported as a jar using gradle functions like this:
task createJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('libs/')
include('classes.jar')
rename('classes.jar', 'myExample.jar')
}
createJar.dependsOn(deleteJar, build)
However after the upgrade, this does not work anymore. In Android Studio i set the Build Variant to "Release", but after running my tasks there will be no JAR in my lib folder. I checked the
build/intermediates/bundles/
folder and theres no release folder generated. There will be just adefault
and adebug
folder.Any way to get an external JAR from a release build again?
The aab file is only in debug folder eventhough already choose release when want to generate sign bundle. This is the path where my project's app. aab files genereated --> Project_path/app/build/outputs/bundle/release.
The top-level build.gradle file, located in the root project directory, defines dependencies that apply to all modules in your project. By default, the top-level build file uses the plugins block to define the Gradle dependencies that are common to all modules in the project.
Android Studio comes with a working installation of Gradle, so you don't need to install Gradle separately in that case. In order to create a new build or add a Wrapper to an existing build, you will need to install Gradle according to these instructions.
Not sure if this is the proper solution but I added this to my gradle file within the android section and the release folder has returned.
publishNonDefault true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With