Sam Pengilly
02/01/2023, 3:40 AMClassNotFound: GradleWorkerMain
error in gradle builds? (Note that’s GradleWorkerMain, not GradleWrapperMain which is more commonly discussed as a source of issues).
This is happening only on CI build machines, and seemingly only upon reaching a test task (assemble ran fine, detekt ran fine, tests fail with that error).
In my CI environment there’s a collection of different projects with different gradle versions and the build machine has a few versions of JDK installed, so I feel like there’s potential for clashes/corruption somehow creeping in, especially since deleting the gradle caches seems to make the problem go away for a little while. Not really sure where to start to diagnose what exactly is triggering it
I’ve found next to no info on it in searches, everything just directs to the aforementions “GradleWrapperMain” error> Task :app:testDebugUnitTest FAILED
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain