I would like to change the APK output folder
and this is what I used to do:
applicationVariants.all { variant ->
variant.outputs.all {
def filePath = "${rootProject.rootDir.absolutePath}/apks/${variant.name}"
println("My Path: " + filePath)
outputFileName = filePath
}
}
However, it didn't work in Gradle 4.1
(Android studio 3.0 preview). Instead of generating the folder as the path above, it generated the above path inside old debug
folder like image below:
Does anyone have a solution for this? Thanks.
I had a similar issue, because I needed the output apk in a known folder and not in a folder depending on the computer user name. So I have fixed like this:
With this I get the apk in: ".../outputs/apk/flavorName/buildTypeName/xxx.apk"
Hope it helps you.
From migration guide:
This is a workaround to keep the output path same after upgrade to gradle 4.x.
now apk is generated at platforms/android/build/outputs/apk/android-release.apk