Flutter environment configuration installation ultimate tutorial
Environment installation process
- java environment
- flutter sdk
- android SDK
- androidstudio
- dart sdk
- vscode
Except for the last vscode, which is optional, the other ones must be installed, and they cannot run without one. We mainly sort out the pits in downloading and installing these things.
1. Java environment configuration
The first step is to configure the java environment. If you don't have it, you can go to the following.
The first step is to download jdk, the portal: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
There is a problem here. Because of the version problem, the configuration environment will be different. The old version needs to be equipped with jre and the new version only uses jdk. When downloading, try to catch jdk8 or above version 8. And when configuring the environment, try to find tutorials on the Internet and try to find tutorials that are more recent. Then the version should be more consistent with yours. If it is too far away, it is easy to cause problems. The website including downloading jdk has changed. When the author downloaded it, it was an old website, and it has been updated. I didn't find the downloading place at first.
After the jdk is downloaded, the environment is matched. Students who have not matched the environment do it by themselves. In addition to java, flutter also needs to be matched later, which is very troublesome. The specific installation recommends this blogger:
https://blog.csdn.net/qq_41436122/article/details/82620080?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-7.channel_param
When installing and downloading jdk, you must be optimistic about your own version and the version of the tutorial to avoid errors.
Test it after matching
java _version
java
二 .flutterSDK
First hang up the official address, everyone go to this place to download
https://flutterchina.club/setup-windows/
If you can’t open it, search flutter directly on Baidu, find the Chinese community, and download it anywhere.
After finding it, first configure the mirror according to the official tutorial
Afterwards, open the environment variables like configuring the java environment
At this time, we have to distinguish, one is the user variable, the other is the system variable, we need to throw the mirror address into the user variable. If you don’t have mirroring, problems will occur, so you should configure mirroring first.
Then you can download flutterSDK after it is configured
Novices recommend the first one, if you have github the second one is fine. This download link seems to be blocked. If there are college students, contact a teacher you know and use the university’s private network to open it. If not, you can only take the ladder yourself (or try another mirror, I haven’t tried).
After downloading, open the downloaded file and find the bin directory and configuration file.
Copy the path of bin and configure it in the path environment variable
Just like java, just put the path underneath.
Test it after you put it. Some computers may respond slowly. Wait a while:
Then find flutter_console
click
Test the flutter doctor again.
The first line is green, which means that the SDK is done well.
Three.android sdk
Then android sdk
To install the Android SDK environment, you can go to this
website address:
https://www.androiddevtools.cn/
android sdk tools .24.4.1 installation package or compressed package will do. Download and unzip it to a disk other than the c drive.
After the download is complete, open it and
look for the SDK Manager, open it as a directory, it may crash, I don’t know why.
Open is a directory, in that bunch of packages, first uncheck all the tick, and then tick according to mine, just select these packages. If you choose too many, you might get a few 10 gigs at a time, and it will split in place. After selecting it, download (install...) in the lower right corner, and remember to click Accept license when downloading.
And .android studio
Some classmates asked me, why do you want to get an android studio? Isn’t it possible to use vscode? I can only say that it’s really impossible without this. All magical errors encountered should be solved with this.
Let's talk about the first mistake first (mine has been fixed, so there is no picture)
Android license not accepted.
What should I do without an Android certificate? Run this flutter doctor --android-licenses
At the beginning, the classics can’t understand the command, and the Android license status unknown error is reported after entering this. Unable to understand the command, need to install several plugins
Open android studio,
Click the Taobo logo next to the small phone in that row of icons.
Pay attention to a few places
Choose the path of your own SDK here, open the SDK Tool and select these packages, check them all, and download them.
If you still have this problem: Flutter requires Android SDK 28 and the Android BuildTools 28.0.3.
You need to download:
Open SDK Platforms and download this:
Download again
Upgrade android manager
/Users/***/Android/sdk/tools/bin/sdkmanager --update, the path is in your android sdk bin directory
Check again flutter doctor
The first and second tick are green.
Five. Dart sdk
The current version of flutter and includes the complete dartSDK, no need to download specially
Six.vscode
Download the dart and flutter plug-ins in vscde, download it and it’s ok