【问题标题】:FLUTTER : Execution failed for task ':app:compileFlutterBuildDebug' Failed to create parent directoryFLUTTER:任务':app:compileFlutterBuildDebug'执行失败无法创建父目录
【发布时间】:2021-11-22 00:26:56
【问题描述】:

我从另一台 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!

【问题讨论】:

    标签: android visual-studio flutter


    【解决方案1】:

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

    之后

    颤抖干净

    然后

    颤动运行

    【讨论】:

      【解决方案2】:

      尝试删除android目录下的build.gradle

      【讨论】:

        【解决方案3】:

        删除 android/app 文件夹中的 build.gradle 解决了我的问题

        【讨论】:

        • 请不要重复其他答案。
        • 我投票删除这个答案,因为这是其他答案的重复
        猜你喜欢
        • 2021-09-25
        • 1970-01-01
        • 2022-07-04
        • 1970-01-01
        • 2021-11-09
        • 2021-08-21
        • 2021-09-26
        • 1970-01-01
        • 2021-12-08
        相关资源
        最近更新 更多