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 三种的其中一个今天特此记录

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,179评论 0 10
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    wgl0419阅读 11,519评论 1 9
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,758评论 2 45
  • 短笛声声 如溪流在耳畈 流淌很久, 那笛声如涓涓细流 淌过她的心田。 寻着笛声 她过来了, 那扇厚重的门 在短笛吹...
    清宇飞鸽阅读 2,548评论 1 13
  • 我有个朋友,叫不香小姐。与其说是不香小姐,还不如说是小臭臭小姐。到考虑到不香小姐且是个小清新妹子,就姑且叫不香小姐...
    七格姑娘在1999阅读 3,184评论 0 1

友情链接更多精彩内容