运行项目,执行flutter doctor 时出现下面的报错:

MacBook-Pro android % flutter doctor        
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.10.2, on macOS 13.0.1 22A400 darwin-arm64, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ 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 license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[] Xcode - develop for iOS and macOS (Xcode 14.3)
[] Chrome - develop for the web
[] Android Studio (version 2021.3)
[] VS Code (version 1.73.0)
[] Connected device (2 available)
[] Network resources

解决方式

1.安装android sdk tools。
在这里插入图片描述
2.安装成功以后 点击finish即可。
在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐