首页 > 解决方案 > “无法找到 Android SDK。”在 Windows 10 上运行颤振医生时

问题描述

目前我的安卓工作室在位置

C:\Android\AndroidStudio

在控制台上

C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[√] Android Studio
[√] Connected device (2 available)

! Doctor found issues in 1 category.

我的 SDK 位置是

C:\Users\aditya jain\AppData\Local\Android\Sdk

1>我已经安装了Android sdk平台工具和Android sdk工具(废弃)

2>我只有一个本地、Loacallow 和漫游文件,但没有平台文件,因为我看过很多 youtube 视频..他们说要添加到路径平台文件,但我在用户的 appdata 文件夹中看不到任何内容(它默认隐藏)。 https://www.youtube.com/watch?v=7GuGlATHYX8&t=195s

3> 为我的 sdk 运行颤振配置命令并得到

C:\Users\aditya jain>flutter config --android-sdk flutter config --android-sdk \C:\Users\aditya jain\AppData\Local\Android\Sdk
Setting "android-sdk" value to "flutter".

You may need to restart any open editors for them to read new settings.

C:\Users\aditya jain>

在这个问题中,flutter 找不到 Android SDK, 有一个答案可以运行

flutter config --android-sdk /path/to/android/sdk

flutter config --android-studio-dir /path/to/android/studio

但我不知道我应该为我的 sdk 位置做什么..我的声誉较低,所以我不能在那里发表评论,所以我在这里发布问题

也试过

C:\Users\aditya jain>flutter config --android-sdk <sdk-"C:\Users\aditya jain\AppData\Local\Android\Sdk">
The syntax of the command is incorrect.

C:\Users\aditya jain>flutter config --android-sdk <sdk-C:\Users\aditya jain\AppData\Local\Android\Sdk>
The syntax of the command is incorrect.

正如在同一个问题中所建议的那样,但在上面给出了这个(我知道我的路径包含空格..我试图把我的 android 放在下载中,这样就不会有空格但我也得到如下错误

C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[!] Android Studio
    X android-studio-dir = C:\Android\AndroidStudio
    X Android Studio not found at C:\Android\AndroidStudio
[√] Connected device (2 available)

! Doctor found issues in 2 categories.

C:\Users\aditya jain>flutter config --android-studio-dir=C:\Users\aditya jain\Downloads\Android\AndroidStudio
Setting "android-studio-dir" value to "C:\Users\aditya".

You may need to restart any open editors for them to read new settings.

C:\Users\aditya jain>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.985], locale en-IN)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[!] Android Studio
    X android-studio-dir = C:\Users\aditya
    X Android Studio not found at C:\Users\aditya
[√] Connected device (2 available)

! Doctor found issues in 2 categories.

C:\Users\aditya jain>

我无法将“aditya jain”文件夹重命名为“adityajain”……它需要空间……请帮助我。

请帮助并感谢社区!

标签: flutterandroid-studio

解决方案


推荐阅读