Problems with flutter installation and configuration

Watch the video: P17 Flutter Windows Android environment to build a real machine debugging
After installation, enter in the command line tool flutter doctorand report an error
insert image description here

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-licensesy all the time.
Reference: flutter installation notes for personal use

3. Windows Version (Unable to confirm if installed Windows version is 10 or greater)

  1. Modify the files in this directory: (FLUTTER-SDK-DIR)\packages\flutter_tools\lib\src\windows\windows_version_validator.dartchange version to version
  2. Delete Files. (FLUTTER-SDK-DIR)\bin\cache\flutter_tools.stamp/
  3. 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:
insert image description here

Guess you like

Origin blog.csdn.net/weixin_50945128/article/details/130459195