【问题标题】:Android Gradle - Cache being locked [duplicate]Android Gradle - 缓存被锁定[重复]
【发布时间】:2016-01-15 09:15:54
【问题描述】:

我真的很困惑为什么这个文件被锁定。

它只锁定特定项目,其他项目都很好,所以可能与我的构建文件有关,但是到目前为止它们一直运行良好。

"Error:Timeout waiting to lock cp_proj class cache for build file 'D:\Users\RU112828\Development\NavX Fuel - Trunk\Fuel-TestApp\test\build.gradle' (D:\Users\user\.gradle\caches\2.8\scripts\build_64jc2uvb9pu0rruzfn4eaqpd1\cp_proj). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 7444
Owner Operation: unknown
Our operation: Initialize cache
Lock file: D:\Users\RU112828\.gradle\caches\2.8\scripts\build_64jc2uvb9pu0rruzfn4eaqpd1\cp_proj\cache.properties.lock"

只有一个构建正在进行,没有同时构建。经过昨天的大量摆弄,我设法清除了缓存,它又恢复了生机。但是今天已经不是这样了,清除缓存后它仍然阻塞。

    buildscript {
    repositories {
        mavenCentral()
        flatDir {
            dirs 'libs'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0+'
    }
}

apply plugin: 'com.android.application'
repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    androidTestCompile fileTree(dir: 'libs', include: 'robotium-solo-5.5.3.jar')
    //    compile 'com.android.support:appcompat-v7:23.1.1'
    compile files('libs/robotium-solo-5.5.3.jar')
}

android {
    compileSdkVersion 'android-15'
    buildToolsVersion '23.0.2'
    android {
        defaultConfig {
            minSdkVersion 15
        }

        lintOptions {
            abortOnError false
        }
        sourceSets
                {
                    androidTest
                            {
                                res.srcDirs = ['res']
                                assets.srcDirs = ['assets']
                            }
                }
    }

}

task assembleDebug(overwrite: true) {}

task copyTask(type: Copy) {
    from 'D:/Users/RU112828/Development/app/myapp.apk'
    into 'build/outputs/apk/'
    rename {
        'test-debug.apk'
    }

    exec { //TODO this is commented out when we do not need a fresh install, when running start up tests then we should un-comment this
        //Force app to uninstall before then being installed.
        commandLine 'cmd', '/c', 'adb', 'uninstall', 'com.my.package'

    }
}

assembleDebug.dependsOn copyTask

该构建脚本是由 Robotium Recorder 生成的,然后我添加了调整以在 assembleDebug 阶段强制卸载应用程序。

谁能告诉我这个文件被锁定的原因。

谢谢

【问题讨论】:

    标签: android gradle build


    【解决方案1】:

    我在我的mac上遇到了这个问题,我只是强行关闭工作室并重新打开它,然后一切正常

    【讨论】:

    • 我已经尝试了更多时间,甚至尝试重新启动,但它无法正常工作 F9,是否有任何其他解决方案...
    【解决方案2】:

    打开你的终端并杀死你知道的进程,通常所有进程都知道 杀死 -9 [id]

    【讨论】:

      猜你喜欢
      • 2017-02-20
      • 2022-06-23
      • 1970-01-01
      • 1970-01-01
      • 2014-03-21
      • 1970-01-01
      • 1970-01-01
      • 2011-06-15
      • 1970-01-01
      相关资源
      最近更新 更多