由于无法删除文件,项目连续无法清除

时间:2019-09-10 21:09:39

标签: android

我浏览了与此主题相关的多个主题,但是没有一个是最近的主题,也许其他人可以帮助我。如果我清理项目甚至尝试重建项目,都会连续收到错误消息

    FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete directory 'K:\Android\DementiaApp\app\build'
    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid\myApp\Games
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid\myApp
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug
    - K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder
    - K:\Android\DementiaApp\app\build\intermediates\transforms
    - K:\Android\DementiaApp\app\build\intermediates

有问题的文件是中间体。我已经看到很多人说您只需要删除此文件。由于某些原因,即使我尝试删除中间体,它们也不会删除!谁能帮我?真烦人。

1 个答案:

答案 0 :(得分:1)

我将针对自己的问题发布解决方案,因为它对我有用,并且将来可能会帮助其他人。无论如何,无论管理权限如何,我的文件都不允许删除它。相反,我重命名了文件,然后Android Studio将其视为“丢失”,并重新生成了另一个构建文件。这使我得以重建和清理项目。现在可以再次使用!