ZipException: invalid block type


I have no idea how to reproduce this. While I was running test repeatedly, suddenly tests started failing, and verting back to versions of my code which previously worked did not help. Those tests use the gradle-tooling-api.

org.gradle.tooling.BuildException: Could not execute build using Gradle distribution ''.
        at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(
        at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$
        at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
        at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(
        at com.tkruse.gradle.groovysh.SimpleSpecification.import custom class(SimpleSpecification.groovy:22)
          Caused by:
        org.gradle.internal.exceptions.LocationAwareException: invalid block type
              Caused by:
            org.gradle.internal.UncheckedException: invalid block type
                  Caused by:
       invalid block type

I ended up deleting anything in ~/.gradle that looked related to 1.12, and then trying again worked. It would be nice if the error message gave an indication of what file caused this exception.

Folders i deleted: