0

你好,我希望你一切都好。在为 Windows 平台编译 Flutter 应用程序时遇到问题。事实上,当我通过按下 VScode(或任何与 Flutter 兼容的 IDE)的“运行”按钮启动我的 Flutter 应用程序时,我在下面出现此错误:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(234,5): error MSB6006: Arrêt de "cmd.exe" avec le code 1. [C:\Users\Acer Aspire\VSCodeProjects\atlas_workspace\build\windows\flutter\flutter_assemble.vcxproj]
Exception: Build process failed.

但奇怪的是,通过使用 Powershell 终端,在我的项目的根目录下,通过执行flutter run -d Windows应用程序编译和启动的命令没有问题。

你能告诉我问题是什么吗?以及如何解决?谢谢

我的Windows版本:windows 10 version 20H2(操作系统版本19042.884)

颤振医生命令的输出:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.3, on Microsoft Windows [version 10.0.19042.844], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.6)
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Community Edition (version 2020.2)
[√] VS Code (version 1.52.1)
[√] Connected device (3 available)

• No issues found!

flutter --version 命令的输出:

Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d7946a68d (2 weeks ago) • 2021-03-18 17:24:33 -0700
Engine • revision 3459eb2436
Tools • Dart 2.12.2

PS:我的操作系统上安装了 Visual Studio 2019 和 C++ 工具

4

2 回答 2

1

已解决!我必须更改我的用户名,使其不能包含任何空格,问题已解决

现在C:\Users\Acer Aspire\VSCodeProjects\atlas_workspace\也是C:\Users\AcerAspire\VSCodeProjects\atlas_workspace\

于 2021-04-03T13:00:49.200 回答
0

这似乎是一个已知的错误,这是因为您的用户名Acer Aspire中有空格:

https://github.com/flutter/flutter/issues/73644

https://github.com/flutter/flutter/issues/75611

于 2021-04-03T08:10:14.953 回答