I rename my output apk file with gradle:
buildTypes {
debug {
...
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("-debug", "-GGG-" + getDate())
)
}
}
}
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmm')
return formattedDate
}
But i get error when try to install app to phone through Android Studio:
The APK file C:\...\app\build\outputs\apk\app-GGG-201604191416.apk does not exist on disk.
Error while Installing APK
However, file what should install named app-GGG-201604191431.apk. Why Android Studio try to install early apk, and how i can solve it?