flutter doctor
を実行すると、次のVisualStudio関連のエラーメッセージが表示されます。
[√] Flutter (Channel master, v1.10.15-pre.405, on Microsoft Windows [Version 10.0.18362.418], locale en-US)
• Flutter version 1.10.15-pre.405 at c:\Users\csell\flutter
• Framework revision 28b5cc3825 (4 hours ago), 2019-11-05 11:50:30 +0100
• Engine revision 7b968ff95f
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\csell\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[!] Visual Studio - develop for Windows (Visual Studio Community 2019 16.3.7)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.3.29424.173
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
MSBuild
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple versions, install the latest one
Windows 10 SDK (10.0.17763.0)
[!] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.39.2)
• VS Code at C:\Users\csell\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.5.1
[√] Connected device (1 available)
• Windows • Windows • windows-x64 • Microsoft Windows [Version 10.0.18362.418]
! Doctor found issues in 2 categories.
x64 Native Tools Command Prompt for VS 2019 cmdプロンプトを実行すると、msbuildなどのさまざまなMSVCツールがコマンドラインで使用できるようになりますが、 flutter doctor
は緩和されません。
スクリーンショットには、必要なSDKバージョンが選択されていないことが示されているため、 doctor
リストされている必要なコンポーネントの1つが欠落しています。
どうやらVS2019では、正確なバージョンではなく、バージョンを「10.0」に設定することが可能になりました。これは、私が最初にこれを調査していたときには不可能でした。 2019年を要求して、それに切り替えることができるようにする必要があるかもしれません。これは、これまでも、そしてこれからも問題点であるためです。
どうすれば問題を解決できますか?
「Windows10SDK(10.0.17763.0)」というコンポーネントをインストールする必要があります
残念ながら、「最新のSDK」の汎用コンポーネントIDはないようです。そのため、10.0に設定し、VS 2019でvswhere
クエリを実行する必要がある場合でも、非常に面倒で、すべてのWindowsでツールの更新が必要になります。 SDKリリース。
次に、バグはflutter doctor
が2つのことをするように言っていることです:
最新のインストールに関する行は、SDKではなくビルドツールに関係しています。 これはフォーマットから明らかなはずですが、インデントがめちゃくちゃになっているように見えます。
インデントを修正し、インデントに関係なく混乱が発生しないように、その行でビルドツールについて再度明示的に言及する必要があります。
この混乱を避けるためにテキストが改善されたため、終了します。 #50487は、この一般的な問題を回避する特定のSDKバージョンの必要性を完全に排除しようとしていることを追跡します。
最も参考になるコメント
「Windows10SDK(10.0.17763.0)」というコンポーネントをインストールする必要があります