When I was trying to build and run a flutter app it shows me the following message: "Could not locate aapt. Please ensure you have the Android buildtools installed. Exception: Problem building Android application: see above error(s)." I already have both build tools and the android sdk installed, so I don't know what might have caused this issue.
-
Does this answer your question? [Flutter does not find android sdk](https://stackoverflow.com/questions/49175231/flutter-does-not-find-android-sdk) – Stf Kolev Mar 12 '21 at 09:04
10 Answers
Going into the folder where the android sdk is located and under the 'build-tools' delete everything inside it, then using android studio re install the build tools this will fix the issue
-
3u r awesome. For all, you will find the SDK path after showing hidden files in "C:\Users[your Local user folder]\AppData\Local\Android\Sdk" – Ibrahim Alqayyas Nov 06 '21 at 11:07
check in cmd flutter doctor something like this will occur
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) X Android SDK file not found: C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3\aapt.
problem is your sdk version 30.0.3 is not installed successfully try to download it seperatelly from https://androidsdkoffline.blogspot.com/p/android-sdk-build-tools.html?m=1
and unzip it and replace its contant with 30.0.3 at location C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3
restart
done

- 91
- 2
For me the issue was resolved by running flutter doctor in cmd. The issue was accepting licenses. Running flutter doctor --android-licenses and then typing y for all licenses resolved the issue.

- 109
- 2
- 2
You can use this command flutter config --android-sdk after updating the android studio and can refer to the path from SDK manager

- 21
- 3
I was able to generate apk but I was also unable to install the apk in device I removed the error by following steps-
- go to C:\Users\aksha\AppData\Local\Android\sdk\build-tools\30.0.3 (check show hidden items option)
- delete this folder inside build-tools (because the error is not installed properly).
- for resolving this issue, we have to uncheck all the latest plateforms (android (S)12 etc) and click apply after this restart the studio and check all these platforms again at least one latest and apply(ok).
- Open Android Studio->files->Settings->Appearence & Behavior->System
Settings->Android SDK->SDK plateforms(Latest)
- run flutter command to accept the licenses. (type Y then enter for all) flutter doctor --android-licenses
- all is done

- 63,369
- 21
- 118
- 128

- 47
- 3
It will be an Android Studio bug. I updated Android Studio to the latest Beta version and fixed it. I hope it will be of help to you too.

- 10,364
- 3
- 38
- 48
If you are using ubuntu check /home/username/Android/Sdk folder present or not, I think your sdk folder deleted or moved to new location. thats why this issue happen.

- 1,067
- 1
- 12
- 25
You must update your build tools of SDK by using SDK manager in android studio. go to androidstudio->sdkmanager->sdktools->then update build tools

- 11
- 1
Delete uncompleted downloads in the "C:\Users\User\AppData\Local\Android\Sdk.downloadIntermediates" folder and reinstall the SDK build tools via the Android Studio's SDK manager.
This problem can be easily solved from Android Studio, follow below steps:
- Click Tools > SDK Manager.
- In the SDK Platforms tab, select Android UpsideDownCake Preview.
- In the SDK Tools tab, select Android SDK Build-Tools 34.
- Click OK to install the SDK
This really worked well for me.

- 1,015
- 3
- 15
- 27