Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
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 install:
sudo gem install cocoapods
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.52.0)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
mac flutter环境搭建
安装国内镜像
下载flutter
此时你会发现,你打开一个新的命令行窗口是,运行
flutter doctor
,会报flutter不存在的错误,是因为环境变量还没全局生效运行flutter
flutter doctor
错误详情
上面的错误信息是告诉你东西未安装完,比如xcode,Android Studio,Android Studio的dart、fultter插件,CocoaPods,VS Code的flutter插件未安装
flutter doctor
,关于Android Studio相关的错误可能还是有,运行下面的命令flutter doctor
,下面这样就都正常了环境变量配置
最终的bash_profile文件