升级 Flutter 后连新项目都无法构建

问题描述 投票:0回答:1

我正在使用 vscode 开发 Flutter 项目。使用 flutter Upgrade 命令将 Flutter 从 3.10 升级到 3.16.3 后,当我创建新项目时,收到以下消息:

[test_project] flutter create --template app --overwrite .
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Creating project ....
Resolving dependencies...
Got dependencies.
Wrote 129 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd .
  $ flutter run

Your application code is in .\lib\main.dart.

exit code 3221225501

当我尝试构建 Windows 项目时,我得到以下信息:

Launching lib\main.dart on Windows in debug mode...
i:\soft\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(248,5): error MSB8066: Custom build for 'I:\work\flutter-projs\test_project\build\windows\x64\CMakeFiles\7e7530df3ca3759e8b25d8281e0718c2\flutter_windows.dll.rule;I:\work\flutter-projs\test_project\build\windows\x64\CMakeFiles\2fbfa67e692ef0c565297c7533a2d0cf\flutter_assemble.rule;I:\work\flutter-projs\test_project\windows\flutter\CMakeLists.txt' exited with code 1. [I:\work\flutter-projs\test_project\build\windows\x64\flutter\flutter_assemble.vcxproj]
Exception: Build process failed.

Exited (-1073741795).

Flutter Doctor 没有发现任何问题。

我认为当它在“flutter Upgrade”之后尝试下载 sky_engine 包时,问题首先显现出来。这是输出:

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Downloading package sky_engine...                               exit code 3221225501

我尝试删除项目中的windows文件夹以及flutter clean、dart pub cache Repair、dart pub cache clean等命令,但仍然不起作用。出了什么问题,我该怎么做才能摆脱退出代码 3221225501 问题并使我的项目成功构建?非常感谢!

flutter build upgrade
1个回答
0
投票

试试这个

打开命令提示符并运行

flutter doctor --android-licenses

然后输入

y
接受所有许可证

© www.soinside.com 2019 - 2024. All rights reserved.