# 检测flutter依赖资源
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v1.12.4, on Mac OS X 10.14.2 18C54, locale zh-Hans-CN)
# 错误1
# 按照提示操作
# 执行1:"/Users/用户名/Library/Android/sdk/tools/bin/sdkmanager" "platforms;android-28" "build-tools;28.0.3"
# 执行2:flutter doctor --android-licenses
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.1)
✗ Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
To update using sdkmanager, run:
"/Users/用户名/Library/Android/sdk/tools/bin/sdkmanager"
"platforms;android-28" "build-tools;28.0.3"
or visit https://flutter.dev/setup/#android-setup for detailed
instructions.
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
# 错误2
# 执行1: 更新MacOS系统,更新Xcode,这个比较耗时间,建议可以先做其他的操作
# 执行1: 更新cocoapod, $sudo gem install cocoapods
[!] Xcode - develop for iOS and macOS (Xcode 10.1)
✗ Flutter requires a minimum Xcode version of 10.2.0.
Download the latest version or update via the Mac App Store.
! CocoaPods 1.5.3 out of date (1.6.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin
code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade:
sudo gem install cocoapods
# 错误3
[!] Android Studio (version 3.5)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
# 解决方案
# 需要安装两个插件:
# Flutter插件: 支持Flutter开发工作流 (运行、调试、热重载等).
# Dart插件: 提供代码分析 (输入代码时进行验证、代码补全等).
# 要安装这些:
# 启动Android Studio.
# 打开插件首选项,具体操作见下图
# 重启Android Studio
# 错误4
# 如字面意思,就是没有测试设备连上
# https://stackoverflow.com/questions/49045393/flutter-run-no-connected-devices
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
————————————————
Mac系统安装JDK1.8及环境变量配置 -