Linux environment to configure Flutter

I configured Flutter environment under Linux system, the specific steps are as follows:

In the flutter official website to download the latest version of the Linux flutter_sdk, here I do not have to download the latest version, leading to flutter always wrong when building the project with Android Studio. After unzipping the download is good.

The first input terminal a command: vim ~ / .bash_profile

Here to point out: Unbutu default does not have this file, you can create a new, specific documents related to Linux environment variable can refer to Linux environment variables .bash_profile .bashrc profile file : https: //www.cnblogs.com/lmh001/p/9999859.html

Then add the following in .bash_profile file (in red font path under the flutter of my computer):

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

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

export PATH=/home/zyubin1229/flutter/bin:$PATH

Save and exit Vim editor window, then enter the second command: source ~ / .bash_profile

Then enter the third command: flutter doctor

This operation might take longer, this time the need to focus attention to network speed, the situation on my computer is slow download ....., so only the wait

Then follow the prompts to download content

After I put the terminal operation is completed, the installation is also a good flutter with Android Studio plug-in, ready to build a flutter project, play a good name, choose a good flutter sdk, informed of the results the following error:

Could not find an option named "androidx". Run 'flutter -h' (or 'flutter   -h') for available flutter commands and options.

Solution: flutter_sdk because I do not have to download the latest version of the download time, leading to flutter sdk version is too low, you can enter commands in a terminal:. Flutter upgrade (Direct suggest that you download the latest flutter_sdk)

The command also time-consuming step.

Published 37 original articles · won praise 10 · views 10000 +

Guess you like

Origin blog.csdn.net/OneLinee/article/details/103949100