简体   繁体   中英

Flutter Android SDK file not found

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!

try this...

open cmd or terminal and run below command

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

hope this will work

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

flutter config --android-sdk

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

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

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 !

在 android studio(Tools->sdk tools->(tick show package details)) 中从 sdk manager 重新安装 sdk 30.0.2 解决了这个问题。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM