I try to change minSdkVersion
in build.gradle
(Module: app) in Android Studio
and get next error:
Error:Timeout waiting to lock buildscript class cache for build file 'E:\pathtoproject\app\build.gradle' (C:\Users\Administrator\.gradle\caches\2.2.1\scripts\build_f00bwdji3qxl7urq5chsbakgv\ProjectScript\buildscript). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 4592
Owner Operation: unknown
Our operation: Initialize cache
Lock file: C:\Users\Administrator\.gradle\caches\2.2.1\scripts\build_f00bwdji3qxl7urq5chsbakgv\ProjectScript\buildscript\cache.properties.lock
What is it error? How to change minSdkVersion
?
This sounds like it's related to https://issues.gradle.org/browse/GRADLE-2795.
The easiest way to solve this will be to delete everything under C:\Users\Administrator\.gradle\caches
. There is a cache.properties.lock
that is holding a global lock which is preventing you from running your script.
For Mac OSX the folder is located in ~/.gradle/caches
. The Android Studio should show the proper path to the file which is causing the lock anyway.
File > Invalidate cache / restart
works for me!!!
I have got the same issue:
To resolve this issue, kill the process which retain the journal with kill -9
command
Log explain perfectly which process is involved in your issue, so you can retrieve the PID or the file path concerned
In this example, the command will be:
kill -9 9739
The lock file is there because some other gradle process (usually the daemon) is using the cache. You could stop all gradle processes to release the lock
gradle --stop
https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With