diff --git a/common.gradle b/common.gradle index a59128c98..bed3522a0 100644 --- a/common.gradle +++ b/common.gradle @@ -80,6 +80,11 @@ android { resources.excludes.add("kotlin-tooling-metadata.json") } + // https://stackoverflow.com/a/77745844 + tasks.withType(com.android.build.gradle.tasks.PackageAndroidArtifact).configureEach { + doFirst { appMetadata.asFile.get().write('') } + } + compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -116,9 +121,7 @@ tasks.register("writeManifestFile") { doLast { File tempFile = android.sourceSets.getByName('main').manifest.srcFile if (!tempFile.exists()) { - tempFile.withWriter { - it.write('\n\n') - } + tempFile.write('\n\n') } } }