Flutter桌面应用程序运行错误MSB4100
因此,我要做的是构建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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您下载了CMDline-Tools
,对于SDK许可证问题,您可以检查这个。
Make sure that you downloaded cmdline-tools
and for the sdk license issue you may check this.