Problem: the flutter doctor waits (spins)

  • 1. Enable global wall climbing
  • 2. Set the current terminal to climb over the wall
export http_proxy=http://xxx:1087; export https_proxy=http://127.x.x.x:1087;Copy the code

Android SDK not found at this location

ANDROID_HOME = /usr/local/opt/android-sdk 
but Android SDK not found at this location
Copy the code

There are two reasons for this

1. The Android SDK is not installed

  • Open Android Studio – top left corner of Preferences – System Setting – Android SDK
  • Configure SDK Platforms and SDK Tools

If there is no optional appearance, need to open the wall first

2. The SDK path is incorrect

  • 2.1 Open the bash or ZSH configuration file, in my case ZSH, with ANDROID_HOME.
Export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL = https://storage.flutter-io.cn export PATH = / Users/xiuji/development/flutter/bin: $PATH # #, combined with the following export ANDROID_HOME=/Users/xiuji/Library/Android/sdkCopy the code
  • 2.2 Copy the address in the figure above and open the terminal
Flutter config - android SDK - "now android SDK path" eg: flutter config - android SDK/Users/xiuji/Library/android SDKCopy the code

Configure 2.1 first, then restart the terminal and run flutte rDoctor. If not, proceed to 2.2

Android Studio not found at X/X

  • I can’t find AS in X over X
  • Then configure the path: Go to the application, find Android Studio, get the path for the application (mine is the Preview version), and configure the path
flutter config --android-studio-dir=/Applications/Android\ Studio\ Preview.app
Copy the code

Some Android licenses are not accepted

Licenses not accepted

[!] Develop Toolchain for Android Devices (Android SDK Version 31.0.0)! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licensesCopy the code
  • Then accept the certificate
flutter doctor --android-licenses
Copy the code

After you run it, you will download Licenses. After downloading, you will be prompted to accept licenses

Accept? (y/N): y
Copy the code

All licenses are displayed when accepted

All SDK package licenses accepted
Copy the code

This step may involve going over a wall

M1 version of the AS

android-studio-apple-m1(preview)