Flutter does not find android sdk

Flutter provides a command to update the Android SDK path:

Use :

flutter config --android-sdk <path-to-your-android-sdk-path>

Choose the folder to install (I called it BASE_PATH) and use the following commands to install SDK with flutter:

Install SDK

cd $BASE_DIR
mkdir android-sdk
cd android-sdk
wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
unzip commandlinetools-linux-6200805_latest.zip
./tools/bin/sdkmanager --sdk_root=$(pwd) "build-tools;28.0.3" "emulator" "platform-tools" "platforms;android-28" "tools"

I used a separate folder for SDK, because it will add parent folders.

Install Flutter

cd $BASE_DIR
wget https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.12.13+hotfix.8-stable.tar.xz
tar xvf flutter_linux_v1.12.13+hotfix.8-stable.tar.xz

Export Vars (you can add them to your .bashrc)

export ANDROID_SDK=$BASE_DIR/android-sdk
export ANDROID_PATH=$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
export FLUTTER=$BASE_DIR/bin
export PATH=$PATH:$ANDROID_PATH:$FLUTTER

Check!

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.12.13, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Android Studio (not installed)
[✓] VS Code (version 1.31.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

Kindly first of all check your latest sdk first step: install latest Sdk platform

second step: Install all these licenses

Now Run

run flutter doctor --android-licenses Press Y against each agreement

run flutter doctor flutter doctor it will work fine.