解决AndroidStudio编译时报错:Timeout waiting to lock artifact cache .

解决AndroidStudio编译时报错:Timeout waiting to lock artifact cache .

1、 错误描述

今天在Android Studio中,使用gradle命令的时候,出现了如下所示的错误:

复制代码

D:\GitLab Source\XTCLint>gradlew clean uploadArchives --stacktrace
Starting a Gradle Daemon, 1 busy and 1 incompatible Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'XTCLint'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Timeout waiting to lock artifact cache (C:\Users\000\.gradle\caches\modules-2). It is currently in use by another Gradle instance.
     Owner PID: 10736
     Our PID: 204
     Owner Operation: resolve configuration ':classpath'
     Our operation:
     Lock file: C:\Users\000\.gradle\caches\modules-2\modules-2.lock

* Try:
Run with --info or --debug option to get more log output.

复制代码

这里写图片描述

2、 解决错误

这里写图片描述

选择【File】–>【Invalidate Caches/Restart】,然后弹出如下所示的弹框

 这里写图片描述

选择【Invalidate and Restart】重启Android Studio

这里写图片描述

点击【Exit】,发现半天都没有重启,下面强制关闭掉 Android Studio 


重启Android Studio之后,运行gradle命令移入报错。

这里写图片描述

下面使用暴力方法,将上面提示的 C:\Users\000.gradle\caches\modules-2 目录下的lock文件删掉

接着重新运行gradle命令,则可以正常运行了

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: 根据引用\[1\]中的信息,"Artifact SchedulingSystem:war exploded: Waiting for server connection to start artifact deployment..."的报错信息表明在部署项目出现了错误。根据引用\[2\]中的描述,可能是因为项目中的WebServlet与其他servlet重名导致的报错。此外,引用\[3\]中提到的解决方式是通过点击clean按钮后重新发布项目来解决该问题。因此,您可以尝试清理项目并重新发布来解决"Artifact SchedulingSystem:war exploded: Waiting for server connection to start artifact deployment..."的报错。 #### 引用[.reference_title] - *1* *3* [Artifact itheima_spring_mvc:war exploded: Waiting for server connection to start artifact deployment](https://blog.csdn.net/weixin_45986454/article/details/122404151)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Artifact 项目:war exploded: Error during artifact deployment. See server log for details.解决办法](https://blog.csdn.net/kqimo/article/details/130398031)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值