java
system_error
ai_generated
true
Build script '/home/user/project/build.gradle' could not be loaded: Could not open cache directory '/home/user/.gradle/caches/8.5/build-cache-1' (Permission denied)
ID: java/gradle-missing-build-script-cache
80%Fix Rate
85%Confidence
0Evidence
2025-08-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8+ | active | — | — | — |
Root Cause
The Gradle cache directory is owned by another user or has incorrect permissions, preventing Gradle from writing to it.
generic中文
Gradle 缓存目录由其他用户拥有或权限不正确,阻止 Gradle 写入。
Workarounds
-
95% success Fix permissions on the cache directory
sudo chown -R $USER:$USER ~/.gradle/caches/8.5/build-cache-1
-
90% success Clear the cache directory and let Gradle recreate it
rm -rf ~/.gradle/caches/8.5/build-cache-1
Dead Ends
Common approaches that don't work:
-
Changing the cache directory to a different path without fixing permissions
70% fail
The new path may also have permission issues or be non-existent.
-
Running Gradle with sudo
80% fail
This can cause ownership issues and is a security risk.