Overview of the Flutter novice environment building and Android Studio configuration and installation issues

Download the Flutter SDK

Flutter. Dev/docs/get – st…

2. Decompress the downloaded SDK to any directory

3. Configure environment variables

  • Win10 -> win + q -> input env

  • Win10 -> computer -> advanced system Settings -> advanced -> environment variables -> system variables

Variable name PUB_HOSTED_URL Variable value https://pub.flutter-io.cn

Variable name FLUTTER_STORAGE_BASE_URL Variable value https://storage.flutter-io.cn

Path Increases the value of the variable (decompressed Path) E:\flutter\bin

4. Run the command on the COMMAND-LINE interface (CLI)flutter doctorThe command

  • CMD must be in administrator mode
  • When you find 1,2, and 3 are not moving, press Enter.

5. Install the Dart plug-in in Android Studio

Open Android Studio -> File -> Settings -> Plugins to search for the Dart plug-in and click Install on the right.

Install the Flutter plugin for Android Studio

7. Create the Flutter project

After the plugin is installed, restart Android Studio for new projects and you will find that the option to create a Flutter project has been added.

8. Download the Nighter simulator

www.yeshen.com/

  • Run the emulator and if found, emulator is not generated in Android Studio

  • Enter CMD in the Nighter simulator bin directory D:\Nox\bin

  • Then run nox_adb.exe connect 127.0.0.1:62001

  • Run the program and if you find a card in Running Gradle task ‘assembleDebug’… Prove that you can’t access Google outside the wall

  • Modify the Android /build.gradle file in your project
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

  • Modify the configuration files of the Flutter, the file in Flutter installation directory/packages/flutter_tools/gradle/Flutter gradle

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
private static final String MAVEN_REPO = "https://storage.flutter-io.cn/download.flutter.io";
Copy the code

  • Running Gradle task ‘assembleDebug’…
  • downloadGradle - 6.3 - all
  • Download address services.gradle.org/distributio…

  • Change to pathDistributionUrl = file \ / E: \ : / flutter/gradle/gradle - 6.3 - all. Zip

9. Run the program

  • The successful running