Я использовал следующий код в своем gradle script для переименования apks, сгенерированного с помощью AndroidStudio:
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent, defaultConfig.versionCode + "_" + output.outputFile.name)
}
}
Таким образом, он генерировал apks с именами, такими как: 345-app-release.apk, где 345 - версияCode.
Но после обновления до AndroidStudio 3.0 он возвращает следующую ошибку:
Невозможно установить значение свойства read-only 'outputFile' для ApkVariantOutputImpl_Decorated {apkData = Main {type = MAIN, fullName = debug, filters = []}} типа com.android.build.gradle.internal.api.ApkVariantOutputImpl.
Как я могу добиться аналогичного переименования с помощью новых инструментов сборки.