1.Flutter Mac端环境配置
#环境配置 #flutter #dart #vpn #快连 #插件 #dart无法运行
推荐vpn使用进行下载 快连vpn 免费试用3天 推荐ID 130935870
0.下载flutter SDK、和SDK的路径存放
通过终端打开根目录
1.在根目录 创建一个development文件夹(文件夹的名字可以随意起)
2.将flutter sdk zip包 放到development进行解压
1.创建 .bash_profile、.zshrc文件
.bash_profile
# export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置
# export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置
export PATH=/Users/liyuhong/development/flutter/bin:$PATH
#dart
# export DART_HOME=/Users/liyuhong/development/flutter/bin/cache/dart-sdk/bin
# export PATH="${DART_HOME}:${PATH}"
.zshrc
# export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置
# export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置
export PATH=PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH
source ~/.bash_profile
2.使用终端
source ~/.bash_profile
source ~/.zshrc
2.1cocoapods安装
sudo gem install cocoapods
Android Studio安装
2.2、cmdline-tools component is missing
2.3 、The operation couldn’t be completed. Unable to locate a Java Runtime. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
安装Java
2.4、更新sdk
/Users/liyuhong/Library/Android/sdk/tools/bin/sdkmanager --update
2.5、Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
flutter doctor --android-licenses
3.检测flutter是否安装成功
flutter doctor -v
4.dart添加配置无法运行
# [vscode报错/bin/sh: dart: command not found,添加环境无效,如何解决?](https://segmentfault.com/q/1010000039040294)