From 338fd9e7b3d4661ca132b6074e2168223f65eb0c Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 9 Dec 2014 19:25:59 +0100 Subject: [PATCH] gradle: fix Cannot set property outputFile on null object. --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 51327d45..e7cb1097 100644 --- a/build.gradle +++ b/build.gradle @@ -84,7 +84,9 @@ android { applicationVariants.all { variant -> if (variant.name.equals('release')) { variant.outputs.each { output -> - output.zipAlign.outputFile = new File(output.outputFile.parent, rootProject.name + "-${variant.versionName}.apk") + if (output.zipAlign != null) { + output.zipAlign.outputFile = new File(output.outputFile.parent, rootProject.name + "-${variant.versionName}.apk") + } output.packageApplication.outputFile = new File(output.outputFile.parent, output.packageApplication.outputFile.name .replace(".apk", "-${variant.versionName}.apk")) }