import java.io.File import java.net.URL tasks.register("publishToGoogle") { doLast { in uploadApkToGoogle(file(File(rootDir, "build/outputs/apk/release/release.apk")).readBytes()) } } tasks.findByName("publishToGoogle").dependsOn(tasks.findByName("assembleRelease"))