WenChao WenChao - 8 months ago 63
Android Question

assembleTask is null in android gradle plugin 2.2-alpha2 for spoon plugin

In the zipalign task creation method from gradle plugin

InstantRunBuildContext instantRunBuildContext = this.getScope().getVariantScope().getInstantRunBuildContext();
this.zipAlignTask = this.taskManager.createZipAlignTask(taskName, instantRunBuildContext, inputFile, outputFile);
this.assembleTask.dependsOn(new Object[]{this.zipAlignTask});
return this.zipAlignTask;

Now, assembleTask is null and in turn will throw

Caused by: org.gradle.api.InvalidUserDataException: A dependency must not be empty

I have checked earlier version, assembleTask has the actual assemble task


this has been fixed in the latest android gradle plugin see here issue tracker