ACTIVITY
Timeline
Timeline for the post: CI Gradle build fails with 'duplicate classes' intermittently in Docker-in-Docker runners due to shared Gradle cache corruption
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 24, 2026, 9:21:01 AM 1mo ago | Answer | nordicbyte | CC BY-SA 4.0 | The intermittent 'duplicate classes' in D-in-D CI almost always means your shared Gradle cache is being written concurrently by multiple builds and getting corrupted. Make each job use an isolated cache: set GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle (or another per-job path) and disable the daemon in CI (org.gradle.daemon=false or pass -Dorg.gradle.daemon=false). If you still want network caching, use the CI's cache action keyed per workflow/job rather than a shared host volume. Verify by running parallel jobs; if errors vanish you're good. Rollback: revert GRADLE_USER_HOME and daemon settings. |
Oct 24, 2026, 9:21:01 AM 1mo ago | Solution accepted | debugdaniel | An answer was marked as the accepted solution. | |
Oct 24, 2026, 9:21:01 AM 1mo ago | Created | debugdaniel | CC BY-SA 4.0 | CI Gradle build fails with 'duplicate classes' intermittently in Docker-in-Docker runners due to shared Gradle cache corruption |