Flutter桌面应用程序运行错误MSB4100

发布于 2025-01-21 04:29:10 字数 2808 浏览 0 评论 0原文

因此,我要做的是构建Windows桌面应用程序。我刚刚遵循了《颤音》文档中写的所有安装步骤。我刚刚在Windows 11计算机上使用命令flutter创建LearningFlutter创建了一个简单的样板。然后,我只在目录内运行flutter run -d windows命令(LearningFlutter),然后遇到此错误:

$ flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100: Expected "$([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))" to evaluate to a boolean instead of "$([System.String]::new('..\flutter\Debug\flutter_wrapper_app.lib;D:\Adil's Files\My Code\learningflutter\windows\flutter\ephemeral\flutter_windows.dll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib').Contains('atls.lib'))", in condition "'$(ATL_KeyFile)' != '' and ('$(ConfigurationType)' == 'Application' or '$(ConfigurationType)' == 'DynamicLibrary') [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100:                          and %(Link.AdditionalDependencies) != '' and  $([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))". [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
Building Windows application...
Exception: Build process failed.

我正在寻找如何解决此问题。如果您的老师可以帮助我解决这个问题,将不胜感激!

我的颤抖的医生配置:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.13.0-0.0.pre.498, on Microsoft Windows [Version 10.0.22593.1], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.3)
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.66.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

您可以说我从字面上不知道颤抖,也从未与它一起制作移动应用程序。因此,您可以对我的新手善待我,请解释一下您为什么这样做或其他任何事情,以便我可以学习。

如果您需要更多信息,请明确要求。我以前从未处理过这些问题,因此我真的不知道该参考要包含什么!感谢您的考虑!

谢谢你/夫人!

So, what I was trying to do is to build Windows desktop apps with Flutter. I just followed all the steps of installation that were written in the documentation of Flutter. I just created a simple boilerplate with the command flutter create learningflutter on my Windows 11 machine. Then I just run the flutter run -d windows command inside the directory (learningflutter), then ended up with this error:

$ flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100: Expected "$([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))" to evaluate to a boolean instead of "$([System.String]::new('..\flutter\Debug\flutter_wrapper_app.lib;D:\Adil's Files\My Code\learningflutter\windows\flutter\ephemeral\flutter_windows.dll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib').Contains('atls.lib'))", in condition "'$(ATL_KeyFile)' != '' and ('$(ConfigurationType)' == 'Application' or '$(ConfigurationType)' == 'DynamicLibrary') [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(469,26): error MSB4100:                          and %(Link.AdditionalDependencies) != '' and  $([System.String]::new('%(Link.AdditionalDependencies)').Contains('atls.lib'))". [D:\Adil's Files\My Code\learningflutter\build\windows\runner\learningflutter.vcxproj]
Building Windows application...
Exception: Build process failed.

I was looking for how to fix this problem. Would be appreciated if you teachers can help me out with this problem!

My Flutter Doctor configuration:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.13.0-0.0.pre.498, on Microsoft Windows [Version 10.0.22593.1], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.3)
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.66.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

You can say that I have literally no idea about Flutter, and never made a mobile app with it. So, you can treat me a newbie and please explain why you did this or that or whatever so that I can learn.

If you need more information, please ask for it explicitly. I never dealt with these problems before so I don't really know specifically what to include as a reference! Thanks for your consideration!

Thank you Sir/Ma'am!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

椒妓 2025-01-28 04:29:10

确保您下载了CMDline-Tools

运行路径/到/sdkmanager - 安装“ cmdline-tools;最新”

,对于SDK许可证问题,您可以检查这个。

Make sure that you downloaded cmdline-tools

Run path/to/sdkmanager --install "cmdline-tools;latest"

and for the sdk license issue you may check this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文