5

When i run a hello world application in flutter

it show

Unable to locate a development device; please run 'flutter doctor' for information about installing additional components.

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\hi\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    X Android SDK file not found: C:\Users\hi\AppData\Local\Android\sdk\build-tools\29.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.

! Doctor found issues in 1 category.

then i tried flutter doctor

after that i get this ..

SanthoshKumar R
  • 111
  • 1
  • 2
  • 7

5 Answers5

13

I spent like half a day solving this issue. For me flutter doctor displayed this error:

X Android SDK file not found: SomeLongPath/Android/sdk/build-tools/30.0.4-rc1/aapt

I just deleted this 30.0.4-rc1 folder because it was empty for some reason, ran flutter doctor and the issue is solved!

FutureJJ
  • 2,368
  • 1
  • 19
  • 30
  • 1
    Thanks. saved a lot of my time. My installation of sdk 32.1.0-rc1 had failed due to network error. that's why the folder was empty. deleting that folder solved the issue. – Omkar76 May 10 '22 at 13:30
6

Error solved:

just uninstalling build-tools 29.0.2 and reinstalling build-tools 29.0.2 in sdk manager android studio

thank you,

SanthoshKumar R
  • 111
  • 1
  • 2
  • 7
2

For my case and after wasting a full day. I was getting:

X Android SDK file not found: 
  C:\Users\user\AppData\Local\Android\sdk\build-tools\31.0.0-rc4\aapt.

So I copied C:\Users\user\AppData\Local\Android\sdk\build-tools\ path and pasted it in a folder directory path to navigate. I deleted a folder named 31.0.0-rc4 and run:

 flutter doctor -v 

again. Hope someone gets helped.

ouflak
  • 2,458
  • 10
  • 44
  • 49
0

I have the same problem, i delete the folder on build-tools/x.x.x that cause the problem and run the flutter app again, it works and it install automatically the build tools needed, this the output of the app when it run

Checking the license for package Android SDK Build-Tools 29.0.2 in /home/mde/Android/Sdk/licenses License for package Android SDK Build-Tools 29.0.2 accepted. Preparing "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)". "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" ready. Installing Android SDK Build-Tools 29.0.2 in /home/mde/Android/Sdk/build-tools/29.0.2 "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" complete. "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" finished.

Mohamed Dernoun
  • 776
  • 5
  • 13
0

Faced the same issue, on 'Android SDK version 31.0.0-rc4'. Tried to remove and reinstall build-tools. Didn't work. The problem was in the SDK tools folder. Removed both build-tools and tools folder. And then Installed Android SDK Command line tools, as well as, Android SDK Platform-tools again

Naimul Kabir
  • 434
  • 6
  • 13