Error: Execution failed for task ':app:clean'. Unable to delete file

項目編譯的時候經常性的遇到這個問題今天就特地的搜索了一下:

I'm trying to rebuild my Android Studio Gradle project (containing mostly Kotlin code), but it started to throw anUnableToDeleteFileExceptionduring the cleaning/rebuilding process:

Execution failed for task ':app:clean'.

> Unable to delete file: C:\Users\User\KotlinGameEngine\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.1\jars\classes.jar

This started happening after I tried to change my project's package

structure. Unfortunately, I did it by renaming and moving the source

folders rather than refactoring through Android Studio, which was a bad

idea.

答案如下:

1.Doing a Gradle sync;

2.Reinstalling Java JRE and Java SDK;

3.Reinstalling the latest version of Android Studio (1.4);

4.Rolling back to the previous AS version (1.3);

5.Invalidating the AS cache and restarting;

6.Deleting the gradle and .gradle directories in the project directory;

7.Deleting the.gradle directory in my user directory;

8.Running gradlew clean? from the AS terminal;

Manually copying the sources over to a new project (weird that it somehow persists across projects...)

我一般都會用678 三種的其中一個今天特此記錄

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,449評論 0 10
  • afinalAfinal是一個android的ioc,orm框架 https://github.com/yangf...
    wgl0419閱讀 6,360評論 1 9
  • afinalAfinal是一個android的ioc,orm框架 https://github.com/yangf...
    passiontim閱讀 15,569評論 2 45
  • 短笛聲聲 如溪流在耳畈 流淌很久, 那笛聲如涓涓細流 淌過她的心田。 尋著笛聲 她過來了, 那扇厚重的門 在短笛吹...
    清宇飛鴿閱讀 329評論 1 13
  • 我有個朋友,叫不香小姐。與其說是不香小姐,還不如說是小臭臭小姐。到考慮到不香小姐且是個小清新妹子,就姑且叫不香小姐...
    七格姑娘在1999閱讀 440評論 0 1