我更新到Android 3.0 4.0级
如何修复问题?
applicationVariants.all { variant ->
variant.outputs.all { output ->
output.outputFile = file("$project.buildDir/apk/" + newName);
if (output.zipAlign) {
output.zipAlign.outputFile =
file("$project.buildDir/apk/" + newName.replace("-unaligned", ""));
}
无法设置只读属性的值" outputFile' ....
答案 0 :(得分:3)
根据the documentation将值分配给outputFileName
:
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}.apk"
}
}