bug信息:
Error:Execution failed for task ‘:android:clean’. > Unable to delete file:F:\StudioProjects\ZXing\android\build\intermediates\exploded-aar\com.android.support\appcompat-v7\22.2.1\jars\classes.jar
主要原因是有2个java(TM)程序在同时打开class.jar 所以导致这个文件无法删除 可以使用下面的方法解开程序锁删除该文件
先安装 lockhuntersetup_3-1-1.exe 不要修改安装路径 下载地址:
在app下的 build.gradle 加入代码(注:不要加在Android根目录下)
task clean(type: Exec) {
ext.lockhunter = '\"C:\\Program Files\\LockHunter\\LockHunter.exe\"'
def buildDir = file(new File("build"))
commandLine 'cmd', "$lockhunter", '/delete', '/silent', buildDir
}
ext.lockhunter = '\"C:\\Program Files\\LockHunter\\LockHunter.exe\"'
def buildDir = file(new File("build"))
commandLine 'cmd', "$lockhunter", '/delete', '/silent', buildDir
}