Flutter Android SDK file not found

Issue

I already have Android Studio installed and tried installing Flutter. After following the instructions, I have encountered a problem. When I run

flutter doctor -v

It returns

[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.18363.1082], locale en-PH)
    • Flutter version 1.22.0 at C:\src\flutter
    • Framework revision d408d302e2 (3 days ago), 2020-09-29 11:49:17 -0700
    • Engine revision 5babba6c4d
    • Dart version 2.10.0

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\%User%\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    X Android SDK file not found:C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt.
    • Try re-installing or updating your Android SDK,
      visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 50.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.48.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.14.1

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

I tried connecting my device too and it didn’t recognize, even after enabling USB debugging. I also tried reinstalling Android Studio. I think the issue lies with the missing ‘aapt’ since it’s not on any folder when i manually looked for it but Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt tells me it should be there.

Thank you for the help!

Solution

try this…

open cmd or terminal and run below command

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

hope this will work

Answered By – pratik vekariya

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published