Java – Gradle refresh failed

Gradle refresh failed… here is a solution to the problem.

Gradle refresh failed

Every time I try to add, compile 'com.soundcloud.android:android-crop:1.0.0@aar'
I get the following error

Error:Timeout waiting to lock buildscript class cache for build file 'C:\Users\De Untouchable\AndroidStudioProjects\Yora\app\build.gradle' (C:\Users\De Untouchable\. gradle\caches\2.2.1\scripts\build_3aewj3nvnlp7huq0b8xvs2ju1\ProjectScript\buildscript). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 5744
Owner Operation: unknown
Our operation: Initialize cache
Lock file: C:\Users\De Untouchable\.gradle\caches\2.2.1\scripts\build_3aewj3nvnlp7huq0b8xvs2ju1\ProjectScript\buildscript\cache.properties.lock

Solution

Clear your gradle cache > delete the entire .gradle folder > project directory. Don’t worry about it being recreated. The same goes for the .gradle -> home directory.

You can also go to “file” -> “invalid” – > “cache/restart”.

Related Problems and Solutions