Flutter window configuration

The first step is to configure environment variables

Configure environment variables in user variables

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

The second step is to download the SDK of Flutter

Download the version of SDK you want from  the fluterSDK address . It is recommended to download the latest stable version for beginners.

The third step is to decompress and configure environment variables

Unzip the downloaded ZIP package into the folder where you want to store fluter. It is recommended that the folder not have English to prevent errors when compiling and searching.

Configure PATH in the user variable. If it already exists, add it later; if it is separated, create a new PATH variable. The configured value is the address of the bin folder in your decompressed flutter file

For example, if I unzip it on the D drive, then my corresponding path is D:\fluter\flutter\bin

After saving, remember to restart the computer or there will be problems running fluter doctor

Run  fluter doctor to know whether the configuration is missing or successful

The corresponding X in the command is something we have not configured successfully. Here, the Android editor Android Studio  editor configuration link is missing   and installed to the place you want to install according to your own installation path.

Go to the plug-in market to download the plug-in

Sometimes when you run flutter doctor, this happens because the local user environment variables are not configured. Configure an  ANDROID_HOME        

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.4, on Microsoft Windows [鐗堟湰 10.0.19041.508], l
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.ht
      On first launch it will assist you in installing the Android SDK component
      (or visit https://flutter.dev/docs/get-started/install/windows#android-set
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (1 available)

Finally, remember to restart the computer or it will not take effect

Sometimes you run the SDK and have the following problem because some Androids are not accepted. Execute   the flutter doctor --android-licenses command, and then press y all the way.

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.4, on Microsoft Windows [鐗堟湰 10.0.19041.508], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (1 available)

! Doctor found issues in 1 category.

 

In this way, the configuration is initially completed, and you can happily knock on your Hello world

Guess you like

Origin blog.csdn.net/qq_37564189/article/details/115621052