Unexpected lock protocol found in lock file. Expected 3, found 2.
Steps to cause this error are simple: gradlew init Uncomment block in build.gradle Create some empty class in src/main/java to force actual compilation and dependency resolution.
07:04:00.921 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on artifact cache (C:\Users\spencer.gradle\caches\modules-1). 07:04:00.931 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
]
Finished executing task ‘:compileJava’ 07:04:00.939 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :compileJava (Thread[main,5,main]) completed. Took 0.106 secs. 07:04:00.946 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 0.106 secs, idle: 0.016 secs ask worker [Thread[main,5,main]] finished, busy: 0.106 secs, idle: 0.016 secs 07:04:00.958 [ERROR] [org.gradle.BuildExceptionReporter] 07:04:00.966 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 07:04:00.975 [ERROR] [org.gradle.BuildExceptionReporter] 07:04:00.981 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 07:04:00.987 [ERROR] [org.gradle.BuildExceptionReporter] Could not resolve all dependencies for configuration ‘:compile’. 07:04:00.994 [ERROR] [org.gradle.BuildExceptionReporter] > Unexpected lock protocol found in lock file. Expected 3, found 2.
modules-1.lock contains hex-code: 0283 46F9 B3
Moving the cache directory aside allowed it to work, but I’ve saved my old cache if necessary for analysis.
-Spencer Note: This topic was created from a reply on the Gradle 1.9-rc-1 is now available for testing topic.