# 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`
- **Domain:** java
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The Gradle cache directory is owned by another user or has incorrect permissions, preventing Gradle from writing to it.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 8+ | active | — | — |

## Workarounds

1. **Fix permissions on the cache directory** (95% success)
   ```
   sudo chown -R $USER:$USER ~/.gradle/caches/8.5/build-cache-1
   ```
2. **Clear the cache directory and let Gradle recreate it** (90% success)
   ```
   rm -rf ~/.gradle/caches/8.5/build-cache-1
   ```

## Dead Ends

- **Changing the cache directory to a different path without fixing permissions** — The new path may also have permission issues or be non-existent. (70% fail)
- **Running Gradle with sudo** — This can cause ownership issues and is a security risk. (80% fail)
