Watch the video: P17 Flutter Windows Android environment to build a real machine debugging
After installation, enter in the command line tool flutter doctor
and report an error
1. cmdline-tools component is missing
Install SDK cmdline-tools in SDK manager — SDK tools
2. Android license status unknown.
Error after running flutter doctor --android-licenses
:
Android sdkmanager tool was found, but failed to run (D:\AndroidTool\sdk\cmdline-tools\latest\bin\sdkmanager.bat):
"exited code 1".
Try re-installing or updating your Android SDK,
Solution : Because the jdk version required by the latest 9.0 command-line is higher than the jdk1.8 used, reinstall the 8.0 command-line, and then run it by pressing flutter doctor --android-licenses
y all the time.
Reference: flutter installation notes for personal use
3. Windows Version (Unable to confirm if installed Windows version is 10 or greater)
- Modify the files in this directory:
(FLUTTER-SDK-DIR)\packages\flutter_tools\lib\src\windows\windows_version_validator.dart
change version to version - Delete Files. (FLUTTER-SDK-DIR)\bin\cache\flutter_tools.stamp/
- run again. flutter doctor
Reason : In fact, the content output in the Chinese environment of windows is different. Overseas use OS Version as a regular expression, and we change it to: OS version in China, so you only need to modify the following code:const String kWindowsOSVersionSemVerPattern = r'^(OS 版本:\s*)([0-9]+\.[0-9]+\.[0-9]+)(.*)$';
It turns out that its code is written in OS Version, just change Version to: version, and it can execute regular expressions normally
reference blog
4. Visual Studio - develop for Windows
To create a windows desktop application, you need to install it, but you can ignore it when developing a flutter app
Final result: