Make writing a habit together! This is my first day to participate in the “Gold Digging Day New Plan ยท April More text challenge”, click to see the details of the activity.

Some time ago, when the Macbook was sent for repair, I could only write code on a Windows computer. I rebuilt the development environment of Flutter. This is the record process of setting up the environment.

  • The Flutter SDK version is 2.8.1
  • Android Studio version: Arctic Fox 2020.3.1 Patch 4

Download the Flutter SDK

Download the latest version of SDK from the official website, here version is 2.8.1, download address: flutter.cn/docs/get-st… Note, after downloading, please pay attention to the official instructions when decompressing the SDK. Do not put the SDK in a folder with higher permissions. It is better to put the SDK in a custom directory other than disk C.

Do not install Flutter into a folder that requires high permissions, such as C:\Program Files\.

Modify the Maven image of Flutter

In the packages\flutter_tools\gradle folder of the flutter installation directory, modify the flutter. Gradle file:

repositories {
   // google()
   // jcenter()
   maven{ url 'https://maven.aliyun.com/repository/google' }
   maven{ url 'https://maven.aliyun.com/repository/jcenter' }
   maven{ url 'http://maven.aliyun.com/nexus/content/groups/public'}}Copy the code

Example Modify system environment variables

Enter “env” on the start menu to open the environment variables screen. Add the bin directory address of flutter to the PATH of the current user of the environment variable.Add two environment variables at the same time to specifyfutter pub getTo get the plug-in repository.

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

PUB_HOSTED_URL
https://pub.flutter-io.cn
Copy the code

Install the Android Studio

Just follow the instructions and install the emulator. Then you need to install the command line tool using sdkManager in the /tools/bin directory of the (Android SDK) directory (you can view the installation directory through Android Studio, as shown below). Developer.android.com/studio/comm…). . The command is as follows:

sdkmanager --install "cmdline-tools; latest"Copy the code

If a license request is displayed, enter Y and press Enter.

Add the SDK license

Run the following command:

flutter doctor --android-licenses
Copy the code

Multiple licenses are displayed. Enter Y to agree.

Checking the Installation Result

runflutter doctorCheck, no problem on the installation is OK.

Record on pit

  • The flutter doctor is stuck: the folder of the flutter was placed in C:/ Program Files and cannot be executed (Windows has no feedback). You need to move the flutter directory to a custom folder on a disk other than DISK C. There is also the problem of scientific Internet access, set the system environment variables and maven image is good.
  • The emulator failed to create a project path with non-ASCII characters. Note that the project directory of flutter cannot have Chinese characters.

I am dao Code Farmer with the same name as my wechat official account. This is a column about the introduction and practice of Flutter, providing systematic learning articles about Flutter. See the corresponding source code here: The source code of Flutter Introduction and Practical column. If you have any questions, please add me to the wechat account: island-coder.

๐Ÿ‘๐Ÿป : feel the harvest please point a praise to encourage!

๐ŸŒŸ : Collect articles, easy to look back!

๐Ÿ’ฌ : Comment exchange, mutual progress!