Gradle:unable to delete file

android studio編譯打包時出錯

Error:Exception failed for task':accountms:clean'.
>Unable to delete file:


解決方法

1、下載lockhuntersetup.exe,直接百度就有下載

2、在build.gradle中寫一段代碼

task clean(type: Exec) {
    ext.lockhunter = '\"F:\\androidworkspace\\lockhuntersetup.exe\\"'
    def buildDir = file(new File("build"))
    commandLine 'cmd', "$lockhunter", '/delete', '/silent', buildDir
}

位置和android {}是同等級的

然後正常編譯

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章