Android工具链-我为Android设备开发(Android SDK版本30.0.3):
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
Android工具链-我为Android设备开发(Android SDK版本30.0.3):
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
当前回答
Windows上的Android SDK管理器截图
从SDK管理器中安装工具请参见附件截图。
其他回答
您的Android SDK版本需要更新。
打开Android Studio→点击顶部栏的Android Studio→首选项→外观&行为(点击打开下拉菜单)→系统设置(点击打开下拉菜单)→Android SDK→SDK工具(选项卡)。
检查Android SDK命令行工具(最新)→应用→单击确定。更新完成后,运行flutter doctor。
外观和行为菜单的截图
我在Windows 10上通过以下操作解决了这个问题:
Run the following command in a Windows command prompt or Flutter console: flutter config --android-sdk "C:\Users\'your computer name' AppData\Local\Android\Sdk" (you may need to find and enter your own SDK path) The Android SDK location could be found in the Android Studio application* → Appearance & Behavior → System Settings → Android SDK Open your Android Studio, and then → File → Settings → Appearance & Behavior → System Settings → Android SDK → SDK Tools → download Android SDK Command-line Tools (latest) and you are good to go.
macOS用户:
flutter config --android-sdk "/Users/{YOUR_USER_NAME}/Library/Android/sdk"
Then
flutter doctor --android-licenses
每一站都输入“y”。
我的解决方案是打开Android Studio,进入SDK管理器,切换到SDK工具选项卡,并检查Android SDK命令行工具(最新)。
不要忘记将SDK中的工具和平台工具文件夹添加到PATH中。
最简单的解决方案:
打开Android Studio,点击Android Studio左上角的设置。 在搜索框中搜索“SDK工具”。 在SDK工具中,只需检查Android SDK平台工具。 让颤振医生去核实一下如果你愿意,你也可以重新启动Android Studio。 我希望问题能得到解决。