Gradle incremental build doesn’t work in my project. After checking debug log i found this error
[org.gradle.api.internal.tasks.compile.incremental.SelectiveCompiler] Full recompilation is required because Test.class could not be analyzed for incremental compilation. See the debug log for more details. Analysis took 0.043 secs.
The strange part is: I dont have Test.class. I also dont have any subclass named “Test”. And above error is the only line of text featuring “Test.class” in debug log.
The gradle version is 7.5.1. I cant switch gradle versions because i use libGDX. Also there is no such error on Linux, but i have to work on Windows.
I just had the exact same problem, of course with a different class name, and would like to share my findings in the hope that they help you or other future readers.
I had hoped that the “debug logs” contained the full class name, but using option
--debug did not reveal it.
Luckily for me, I quickly found the class in one of the external libraries that are used as compile dependencies. It seems that those libraries are scanned as well, perhaps to look for changes that affect incremental compilation.
In my case, the library contained a folder
META-INF/versions/19 with the reported class. It seems to me that Gradle was unable to parse that class due to it using features that are not supported in the Java version 17 I was using.
Again luckily for me, that library was not needed during compilation, so I could move it to the
runtimeOnly configuration and now my incremental compilation works again.
Kind regards and best of luck,