Gradle "problems were found storing the configuration cache" in CI
With the configuration cache enabled, Gradle records the task graph and forbids accessing live build state at execution time. When a task reads project or the environment during execution, Gradle reports configuration cache problems.
What this error means
The build fails (or warns) with "N problems were found storing the configuration cache" and a report listing each disallowed access, such as "invocation of Task.project at execution time".
1 problem was found storing the configuration cache.
- Task `:app:myTask` of type `MyTask`: invocation of 'Task.project' at execution time is unsupported.
See https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
See the complete report at file:///.../build/reports/configuration-cache/....htmlCommon causes
A task reads live project state at execution time
The task calls project.<x> or accesses build services during its action rather than capturing values at configuration time, which the configuration cache forbids.
A plugin is not configuration-cache compatible
A third-party plugin accesses disallowed state, surfacing problems you did not write.
How to fix it
Capture inputs at configuration time
- Open the linked configuration-cache HTML report to see each access.
- Move
project/ env reads out of the task action into properties captured during configuration. - Re-run so the task no longer touches live state at execution.
abstract class MyTask : DefaultTask() {
@get:Input abstract val version: Property<String>
@TaskAction fun run() { println(version.get()) } // no project.* here
}Upgrade or replace an incompatible plugin
If a plugin causes the problems, upgrade it to a configuration-cache-compatible version, or gate the cache off until it is fixed.
./gradlew build --no-configuration-cacheHow to prevent it
- Capture task inputs at configuration time, not in the task action.
- Use configuration-cache-compatible plugin versions.
- Enable the configuration cache locally so problems surface before CI.