zoukankan      html  css  js  c++  java
  • 解决AndroidStudio编译时报错:Timeout waiting to lock artifact cache .

    1、 错误描述

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

    D:GitLab SourceXTCLint>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:Users00.gradlecachesmodules-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:Users000.gradlecachesmodules-2modules-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:Users00.gradlecachesmodules-2 目录下的lock文件删掉

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

  • 相关阅读:
    【转】使用TortoiseSVN搭建本地的版本控制库
    操作系统的大端小端
    从《王者荣耀》谈游戏的帧同步
    二叉搜索树的第K大节点
    Mysql千万级大表优化
    海量数据存储方案
    递归函数思维
    time_wait的快速回收和重用
    Nginx配置反向代理服务器
    MySQL-怎样使update操作sleep一段时间
  • 原文地址:https://www.cnblogs.com/lliuhh/p/8682439.html
Copyright © 2011-2022 走看看