首页 > 解决方案 > FLUTTER:任务':app:compileFlutterBuildDebug'执行失败无法创建父目录

问题描述

我从另一台 PC 复制了我的项目,并尝试在真实设备上运行我的应用程序,然后我得到了这个错误代码:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Failed to create parent directory 'C:\Users\user' when creating directory 'C:\Users\user\AndroidStudioProjects\app_name\android\app\build\intermediates\flutter\debug\flutter_assets'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

我尝试使用flutter clean但仍然相同

然后我的这个结果flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.1237], locale en-ID)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio
[√] VS Code (version 1.60.2)
[√] Connected device (3 available)

• No issues found!

标签: androidvisual-studioflutter

解决方案


我通过删除android/app 目录中的build文件夹解决了我的问题。

在这之后

扑干净

然后

颤振运行


推荐阅读