Configure the environment
Check the shell environment first. Enter CHSH on the terminal and enter the password. /bin/xxxx is displayed
Using the Bash environment
Vim ~/. Bash_profile Enter the command line and press Enter. Bash_profile Configure the image address export PUB_HOSTED_URL=pub.flutter- IO. Cn export FLUTTER_STORAGE_BASE_URL=storage.flutter- IO After entering the editing mode, press ESC to exit the editing mode and enter :wq to return to the command line. After exiting the editing mode, do not forget to enter source ~/.bash_profile on the command line to save the configuration
Use the ZSH environment
Open ~/.zshrc Add the following sentences: export PUB_HOSTED_URL=pub.flutter- IO. Cn export FLUTTER_STORAGE_BASE_URL=storage.flutter- IO
Install the Flutter
Git files are missing.
- Download the zip package from github.com/flutter/flu…
- Unzip it into a new folder
- Export PATH=XXXXXX:$PATH (XXXX is the location of the bin folder under the installed flutter folder, you can also drag it to the folder)
- Save the environment variables file
Note: after decompressing the folder, you need to add a Git file to continue
Method 2 (It is very slow to clone from Gitub, so it is recommended to use the Git path on the code cloud)
Github address: github.com/flutter/flu… Gitee address: gitee.com/mirrors/Flu… The command line input downloads the latest test version
git clone -b beta https://github.com/flutter/flutter.git
Copy the code
Below are the specified versions
Git clone - b v1.7.8 https://github.com/flutter/flutter.gitCopy the code
Download the latest stable version below
git clone -b stable https://github.com/flutter/flutter.git
Copy the code
After downloading, configure the environment variables of the flutter path by adding the bin location of the flutter to bash_profile/ ZSHRC
export PATH=${PATH}:/xxx/xxx/Flutter/bin:$PATH
Copy the code
flutter doctor
Enter Flutter Doctor and check the environment output report. The first time a flutter command (such as flutter Doctor) is run, it downloads its own dependencies (such as Dart) and compiles them. It will run much faster later.
Once you have installed any missing dependencies, run the flutter doctor command again to verify that you have set up the flutter properly. Follow the error message below one of the items, if the item that passes is preceded by a check sign
Exception in thread “main” java.lang.NoClassDefFoundError
Go to Android Studio->SDK Manager->Android SDK ->SDK Tools ->Android SDK Command-line Tools and click Apply. Flutter doctor — Android licenses is good
IOS Settings
Sudo xcode - select - switch/Applications/xcode. The app/Contents/Developer to install xcode command line tools after open xcode will install command line toolsCopy the code
Installing a plug-in
Open Plugins, search for the Flutter and Dart installation, and restart to create the Flutter project