flutter doctor 失败
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
第一步:目录建立软连接
Android Studio (version 4.1):Flutter plugin not installed and Dart plugin not installed
2020年11月09日 14:36 | 七九推 | 我要评论
问题原因
今天在Mac上安装Flutter开发环境时,用 flutter doctor
命令去检测,flutter 和 dart 插件都装好了,却始终检测不到这两个插件,错误如下图所示:
怀疑是Android Studio的版本问题,换了3.x的版本是可以,后来经过查阅得知。Android Studio (4.1) 的插件位置换成了~/Library/Application\ Support/Google/AndroidStudio4.1/plugins
,而老版本的位置为~/Library/Application\ Support/AndroidStudio4.1
,所以用 flutter doctor
这个命令去检测时,还是会去原来的位置查找这两个插件找不到。
解决办法
给新目录添加软连接,
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1
控制台执行后,再去检测就可以了,
如果第一步还没有搞定,请用第二步,使用dev进行编译
设置环境变量
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
使用dev进行编译
flutter channerl dev
注意:下载和编译时间有点长,要有心理准备