From the Gradle 7.5 release notes:
Configuration caching introduces a number of requirements regarding the build logic. Many problems are already reported in the HTML report. At the moment, adjusting the build logic to be fully compatible with configuration cache can be a significant effort for complex builds.
This release introduces the STABLE_CONFIGURATION_CACHE flag allowing gradual rollout of the most potentially disruptive requirements. This flag currently enables validations like detecting undeclared shared build service usage and external processes used at configuration time.
It is recommended to enable this flag as soon as possible in order to be ready for when the flag is removed and make the linked features enabled by default.
Learn more about what this feature flag enables in the user manual.
We should enable the flag in our build.