Gradle causes Dagger annotation processor to crash in Groovy builds

I’ve just had a discussion with Daz from GradleWare, in a related news group thread, and he explained that he believed this issue was due to forking of the Groovy Compiler.

He explained that by default Java builds are not forked, but Groovy builds are.

Based on that I was able to experimentally verify that if I enable forking for Java compilation, I can reproduce this problem with Dagger. And if I disable forking in Groovy compilation I can work around this problem.

compileGroovy {

groovyOptions.fork = false

}