Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle "Could not open buildscript class cache" - is there a better way to resolve?

Tags:

gradle

After adding a dependency to a .gradle file, our build server started having issues with the following being logged:

FAILURE: Build failed with an exception.  * What went wrong: Could not open buildscript class cache for build file '/u01/apps/.jenkins/workspace/[path name snipped]/build.gradle'     (/home/[username]/.gradle/caches/1.3/scripts/build_5jii90b0hvl37q9m8vfhik495b/ProjectScript/buildscript). > java.io.EOFException 

We were able to resolve it by clearing the gradle cache on the build slaves. However, I'm concerned that this is just a temporary fix and it might show up again. Is there a better way to fix this issue?

like image 762
edclrk Avatar asked Dec 31 '12 16:12

edclrk


2 Answers

go to location ".gradle\caches\2.0\scripts\build_7l4t45nbnsvdcl79ol8u0beli4\ProjectScript" and remove cache.properties.lock file

like image 130
Sachin singh Avatar answered Oct 16 '22 01:10

Sachin singh


That exception typically occurs due to corrupted cache files.

Deleting the cache do work in most cases.

Linux

rm -rf ~/.gradle/caches 

Windows

Delete the %USER_HOME%.gradle/caches folder

like image 24
Gayan Weerakutti Avatar answered Oct 16 '22 00:10

Gayan Weerakutti