简体   繁体   English

未找到 Flutter Android SDK 文件

[英]Flutter Android SDK file not found

I already have Android Studio installed and tried installing Flutter.我已经安装了 Android Studio 并尝试安装 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.我也尝试连接我的设备,但即使启用 USB 调试,它也无法识别。 I also tried reinstalling Android Studio.我还尝试重新安装 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.我认为问题在于丢失的“aapt”,因为当我手动查找它但未Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt告诉我它应该在那里。

Thank you for the help!感谢您的帮助!

try this...尝试这个...

open cmd or terminal and run below command打开 cmd 或终端并运行以下命令

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 ).我通过删除C:\...\build-tools\中不包含aapt.exe -> 30.0.230.0.3的两个最新文件夹来修复它(这个删除的文件夹只包含一个名为.installer的文件夹) .

This answer inspired me : https://stackoverflow.com/a/56995320/13170425这个答案启发了我: https ://stackoverflow.com/a/56995320/13170425

flutter config --android-sdk颤振配置--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.您安装了 Android SDK 并且 1 注意到设备未仅连接。 You can install the android SDK from the link below:您可以从以下链接安装 android SDK:

https://developer.android.com/studio#downloads 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.我遇到了同样的问题Android SDK 文件未找到: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"在 SDK Manager 中,转到 SDK tools ,并选中复选框“显示各种包”并取消选中“隐藏过时的包”

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)现在在 Android SDK Build-tools 31 下,安装 31.0.0 并应用在 Android SDK 命令行工具(最新)下,安装 Android SDK 命令行工具(过时)

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:在我的问题中,找不到 32 aapt。,我尝试了很多:

  1. flutter config --android-sdk [path]颤振配置--android-sdk [路径]
  2. uninstall 32 and install again卸载 32 并重新安装
  3. install low version like 31(30)安装低版本如31(30)
  4. and so on等等

still not work until:直到:

  1. uninstall 32卸载 32
  2. remove folder 32 which need aapt.删除需要 aapt 的文件夹 32。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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