1

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!

Blooming
  • 43
  • 1
  • 8

7 Answers7

2

try this...

open cmd or terminal and run below command

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

hope this will work

pratik vekariya
  • 1,105
  • 1
  • 8
  • 14
  • 1
    It still didn't work. I think the issue lies with the missing 'aapt' since it's not on any folder when i manually looked for it. Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt tells me it should be there. – Blooming Oct 02 '20 at 06:54
  • check you android sdk, like i have android sdk in "D:\android_sdk\". i think you given path "C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt", this path is wrong. I run above command like " flutter config --android-sdk D:\android_sdk\" – pratik vekariya Oct 02 '20 at 11:25
2

I had the same problem today :

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) X Android SDK file not found: C:\Users\admin\AppData\Local\Android\Sdk\build-tools\30.0.3\aapt.

I fixed it by deleting the two most recent folders in C:\...\build-tools\ which do not contain aapt.exe -> 30.0.2 and 30.0.3 (This deleted folders only contained a folder named .installer).

This answer inspired me : https://stackoverflow.com/a/56995320/13170425

Xsims
  • 201
  • 1
  • 11
1

I had the same problem today. In my problem, can not find 32 aapt., I had try many:

  1. flutter config --android-sdk [path]
  2. uninstall 32 and install again
  3. install low version like 31(30)
  4. and so on

still not work until:

  1. uninstall 32
  2. remove folder 32 which need aapt.
user19048898
  • 31
  • 1
  • 4
0

flutter config --android-sdk

run this command and run flutter doctor again this should help you

Akshay Kumar U
  • 406
  • 3
  • 10
  • It still didn't work. I think the issue lies with the missing 'aapt' since it's not on any folder when i manually looked for it. Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt tells me it should be there. – Blooming Oct 02 '20 at 06:51
0

That's not a big deal. You install the Android SDK and 1 notice that the device is not connected only. You can install the android SDK from the link below:

https://developer.android.com/studio#downloads

Souvenir
  • 108
  • 5
  • It still didn't work. I think the issue lies with the missing 'aapt' since it's not on any folder when i manually looked for it. Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt tells me it should be there. – Blooming Oct 02 '20 at 06:51
  • You double-check the path to the SDK file to see if it is correct? You just need to install the SDK file as below. Here is my path: /Users/admin/Library/Android/sdk – Souvenir Oct 02 '20 at 07:26
0

I had the same issue Android SDK file not found: C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\31.0.0\aapt.

I had already tried other solutions but this worked for me . In SDK Manager , go to SDK tools , and check the checkbox "Show the various packages" and uncheck "Hide obsolete packages"

Now under Android SDK Build-tools 31 , install 31.0.0 and apply Under Android SDK Command-line tools (latest), install Android SDK Command-line tools (obsolete)

This worked for me , hope it works for you too !

0

Reinstalling the sdk 30.0.2 from sdk manager in android studio(Tools->sdk tools->(tick show package details)) fixes the problem.