1、打开配置文件 方式一:vim ~/.bash_profile vim编辑 退出vim: 编辑状态下,按esc, 输入 :wq 保存退出 方式二:open ~/.bash_profile 打开配置文件 可视化编辑 2、编辑配置文件
export PATH=/Users/yangjian/Documents/Flutter/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=$PATH:/Users/yangjian/Library/Android/sdk/platform-tools
export PATH=$PATH:/Users/yangjian/Library/Android/sdk/tools
其中/yangjian/Documents/Flutter/flutter/bin 的是flutter sdk解压的目录
3、刷新
source ~/.bash_profile
4、检测
flutter doctor
注:不能全局使用flutter的时候 参考下面 https://blog.csdn.net/iotjin/article/details/105629266
报错一,装jdk. http:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http:
报错二,1、配置java环境变量 参考(https:
2、flutter doctor --android-licenses 每个协议都y下
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
? Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https:
more details.
解决所有。
|