我一直在成功地使用 flutter windows 来运行我的应用程序。但是,最近我下载了 Android Studio,突然间我的 flutter windows 不起作用了。它抛出了如下错误:
Launching lib\main.dart on Windows in debug mode...
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C:\Users\Schwar
tzLab\PycharmProjects\bahavior_rig\behavior_gui\build\windows\CMakeFiles\3a7123e8b5d134f8b6f9d9b7be4b7e62\flutter_windows.dll.rule;C:\Users\SchwartzLab\PycharmProjects\baha
vior_rig\behavior_gui\build\windows\CMakeFiles\350a25350ac520c3b2e8372c37f12801\flutter_assemble.rule' exited with code 1. [C:\Users\SchwartzLab\PycharmProjects\bahavior_ri
g\behavior_gui\build\windows\flutter\flutter_assemble.vcxproj]
Building Windows application...
Exception: Build process failed.
我卸载了 Android Studio 并重新安装了 Visual Studio 2019 和 flutter。但是错误仍然存在。
这是颤振医生:
[√] Flutter (Channel dev, 2.3.0-16.0.pre, on Microsoft Windows [Version 10.0.18363.1621], locale en-US)
• Flutter version 2.3.0-16.0.pre at C:\Users\SchwartzLab\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fa5883b78e (4 weeks ago), 2021-05-21 13:04:03 -0700
• Engine revision 2f067fc4c5
• Dart version 2.14.0 (build 2.14.0-136.0.dev)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\SchwartzLab\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Users\SchwartzLab\anaconda3\envs\bahavior_rig_\Library\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.6+8-b765.1)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.2)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.10.31410.357
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[√] VS Code (version 1.57.0)
• VS Code at C:\Users\SchwartzLab\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.20.0
[√] Connected device (4 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18363.1621]
• Windows (UWP) (desktop) • winuwp • windows-uwp-x64 •
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.101
• Edge (web) • edge • web-javascript • Microsoft Edge 89.0.774.68
! Doctor found issues in 1 category.
在另一台笔记本电脑上构建相同的应用程序。
答案 0 :(得分:0)
从来没有遇到过这个问题。我使用的是稳定版。
[✓] Flutter (Channel stable, 2.0.5, on Microsoft Windows [Version 10.0.19043.1052], locale en-US)
[✓] 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.9.4)
[✓] Android Studio (version 4.1.0)
[✓] VS Code, 64-bit edition (version 1.57.1)
[✓] Connected device (3 available)
尝试将 Channel dev
切换为 Channel stable
。