diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index 5423810ff3..cba06db396 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -373,12 +373,22 @@ tasks.register("renameReleaseBuilds") { } tasks.register("copyReleaseApks") { - from("${layout.buildDirectory}") { - include("**/*release*.apk") - } - includeEmptyDirs = false - into("${rootProject.rootDir}/release") + + into( + File(rootProject.rootDir, "release").apply { + if (!exists() && !mkdirs()) { + error("Can't create $name") + } + } + ) + + with( + copySpec { + from(layout.buildDirectory) + include("**/*release*.apk") + } + ) eachFile { //replace path to copy only apk file to the destination folder(without subdirectories)