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

后端 未结 30 1178
感动是毒
感动是毒 2020-11-29 17:19

I\'m trying to rebuild my Android Studio Gradle project (containing mostly Kotlin code), but it started to throw an UnableToDeleteFileException during the clean

相关标签:
30条回答
  • 2020-11-29 18:17

    I had the same problem and this worked for me:

    1. close Android Studio.
    2. delete intermediates directory (as long as Android Studio is opened, this directory can't be deleted)
    3. open Android Studio again
    0 讨论(0)
  • 2020-11-29 18:18

    If you are testing with a local backend (java servlet on local google app engine) the running process blocks some files. So you are not able to live deploy. So in this case you can solve this by stopping the local backend before starting clean or build. You find the option under "Run -> Stop backend".

    0 讨论(0)
  • 2020-11-29 18:19

    I solved this one in my ubuntu like this.

    1. Check for the processes running in your system(Ubuntu) like in task manager in windows.

      Ubuntu terminal command to list out all processes running ----> "gnome-system-monitor"

    2. Terminate or end the JAVA and ANDROID processes in the list.

    3. Again start the studio and import project.

    Its works for me without any problems. Hope this helps...

    I thought this is the problem with the process that are already created and Duplicated.

    0 讨论(0)
  • 2020-11-29 18:19

    Some times intermediates creates problem so delete it and Rebuild project

    OR

    simply run cmd command - > gradlew clean

    in your project folder in work space (its work for me)

    0 讨论(0)
  • 2020-11-29 18:19

    I had the same error, tried multiple ways but the solution worked for me was to delete build folders from /android and /android/app directories.

    run react-native run-android worked for me.

    0 讨论(0)
  • 2020-11-29 18:20

    Cleaning the project in Android studio and running again fixed the issue. May be do "Make Project" as well.

    0 讨论(0)
提交回复
热议问题