Gradle "Could not create service of type ..." - Fix Daemon Startup in CI
By Kaveh Alemi·Latchkey
Gradle failed while wiring up its internal services at startup. Could not create service of type ... means the daemon could not initialize - usually a corrupt or unwritable ~/.gradle (the Gradle user home), or a JDK the Gradle version cannot run on.
What this error means
The build fails before any task with Gradle could not start your build. and Could not create service of type <X> using <Services>. It happens during bootstrap, not in your build logic.
gradle output
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not create service of type FileHasher using
GradleUserHomeScopeServices.createCachingFileHasher().
> Could not open ... cache (corrupt).
Common causes
Corrupt or unwritable Gradle user home
A corrupt ~/.gradle/caches, or a Gradle user home the job user cannot write (wrong ownership in a container, HOME unset), stops service initialization.
Incompatible JDK running Gradle
Running Gradle on a JDK outside its supported range can break service creation during bootstrap, before your build is configured.
How to fix it
Reset the Gradle user home
Clear caches and ensure the Gradle user home is writable by the job user.
Set GRADLE_USER_HOME to a writable, cacheable path in CI.
Ensure HOME and ownership are correct for the job user in containers.
Keep the Gradle wrapper aligned with a supported JDK.
Frequently asked questions
What causes ""Could not create service of type""?
A corrupt ~/.gradle/caches, or a Gradle user home the job user cannot write (wrong ownership in a container, HOME unset), stops service initialization.
How do I fix "Could not create service of type"?
Clear caches and ensure the Gradle user home is writable by the job user.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.