It is currently in use by another Gradle instance解决

在使用gradle编译Android工程的时候,报如下错误:

It is currently in use by another Gradle instance

尝试解决方法如下:

1、删除工程中的.gradle和.idea目录后重新编译

2、Andorid studio File->invalidate caches/Restart

3、ps -ef | grep java 和ps -ef | grep gradle 并杀掉找到的线程

以上三种方法单个使用或者组合使用,有时能成功,有时不能成功。接下来的方法亲测会成功

1、terminal中执行命令 find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done

2、build->clean project

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容