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:22

    I had the same problem and I solved it by moving project folder into ext4 partition

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

    If you are using Android Studio 2.0 Beta, this issue might appear (more likely if you are working on NTFS filesystem) and it seems like the "Instant Run" is the culprit. Search for "Instant Run" in settings and uncheck the box.

    I have filed an issue on the bug tracker.

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

    react native devs

    run

    sudo cd android && ./gradlew clean
    

    and if you want release apk

    sudo cd android && ./gradlew assembleRelease
    

    Hope it will help someone

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

    For me, this happened because of an active debugging process. So, before cleaning or rebuilding, make sure to kill all active processes. To nail down the success, execute Invalidate Caches/Restart.

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

    For me it helps when I Exit Android Studio, click one more time Clean Project (it appears the same error) and next click Make Project - after that of course Run 'app' button in Android Studio.

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

    This issue appeared to me in android studio 2.0 stable channel and the solution was due to a problem happened while updating my android studio i solved this by installing a fresh android studio. after deleting all old files for the old installation. and to keep the very nice feature of Instant Run

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