1.在官网https://flutter.dev/docs/development/tools/sdk/releases?tab=macos
下载flutter_macos_v1.5.4-hotfix.2-beta.zip文件
2.解压到想要安装的目录
cd ~/development
unzip ~/Downloads/flutter_macos_v1.5.4-hotfix.2-beta.zip
3.配置~/.bash_profile
终端输入:open ~/.bash_profile
加入下面变量
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
flutter目录/bin:$PATH
4.让.bash_profile生效:终端输入source .bash_profile
5.运行 flutter doctor: 终端输入flutter doctor
问题一:Flutter项目卡在Initializing gradle...界面的问题
https://www.jianshu.com/p/407d3ca7037e
注意gradle的位置
E7763822-C1E4-41F1-9812-C629C5B92773.png
问题二:Flutter项目卡在Resolving dependencies...界面
Terminal -> 输入flutter run 等待一会儿,出现下方截图即可
网友评论