Hi,
to have a better idea what I just build I renamed my APKs according a few rules using this:
buildTypes {
//debug, release, etc...
applicationVariants.each { variant ->
def apk = variant.packageApplication.outputFile;
def newName = "";
newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-" + variant.buildType.name.toUpperCase() + ".apk");
variant.packageApplication.outputFile = new File(apk.parentFile, newName);
if (variant.zipAlign) {
variant.zipAlign.outputFile = new File(apk.parentFile, newName.replace("-unaligned", ""));
}
}
}
Result is something like "MyCoolApp-v1.0.15-RELEASE.apk"
While this is working well on the cmd line I get an error when trying to install the app from Android Studio since it doesn't pick up the changed name and only fails with
"Local path doesn't exist."
Is there a rename the apk within gradle so Android Studio understands it?
Cheers,
Stefan