preface

Under the great Wave of Flutter, THE author also began to sink into a pit. This series aims to record the learning process, welcome to discuss together.

Software to be prepared

  • Android Studio 3.0.0 above
  • Android SDK
  • git

Begin to build

  • 1. Download the Flutter installation package and decompress it

Download from Flutter Chinese website or Github. Download from flutter website is recommended.

  • 2. Add environment variables

Add the full Path of the installation package \bin directory to the Path system variable. For example, the full Path is D:\flutter\flutter\bin, which is in English with the previous variable. Separated.

Due to domestic access restrictions, the following two variables need to be added. Please note that the values of these variables may change, and the values published on the official website shall prevail

Key: PUB_HOSTED_URL

Value: https://pub.flutter-io.cn

Key: FLUTTER_STORAGE_BASE_URL

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

If you haven’t added the ANDROID_HOME variable, you need to add it again. The value is the path where the Android SDK is located, such as D:\ Android \ SDK. Remember to restart the computer after adding it.

  • 3. Runflutter doctorThe command

Open the flutter_console.bat file in the installation directory and enter FLUTTER doctor. If the following information is displayed, flutter doctor is successfully configured

  • 4. Frequently Asked Questions

1). An error

Error: The Flutter directory is not a clone of the GitHub project.
   The flutter tool requires Git in order to operate properly;
   to set up Flutter, run the following command:
   git clone -b beta https://github.com/flutter/flutter.git
Copy the code

This problem occurs when you download from Github

Solution: delete the Flutter just downloaded installation package, back in to install directory to run the git clone – b beta at https://github.com/flutter/flutter.git

2). Error: no \flutter\bin\cache. Do not put the decompression folder in a high permission path, such as C: Program Files\

3). An error

flutter

  • 5.Android StudioThe installationflutterThe plug-in

Search for the Flutter installation

  • 6. Newflutterproject

File–>New–>New Flutter Project

Flutter Application

  • 7. Run the project

Perhaps when you want to run a project, there are no devices available to run it

First, you need to add the ANDROID_HOME environment variable; Then run the flutter devices command in Terminal. At this time, the connected machine can be seen.

Your recognition is the motivation for me to keep updating my blog. If it is useful, please give me a thumbs-up. Thank you