如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

出现的现象 android studio 4.1已经安装了flutter和dart插件,但是执行 flutter doctor依然报错。

[!] Android Studio (version 4.1)
? Android Studio at /Applications/Android Studio.app/Contents
? Flutter plugin not installed; this adds Flutter specific functionality.
? Dart plugin not installed; this adds Dart specific functionality.
? Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
虽然安装了flutter和dart的插件,还是提示没有安装。

Plugin folder has changed in 4.1 version;
From : ~/Library/Application\ Support/AndroidStudio4.1
To: ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins

找不到的原因

主要原因就是在Android studio 4.1中plugin目录发生了变化,如果是macos或者linux系统,添加以下软连接即可:
ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

如果是windows系统,可以通过更新flutter版本来解决,具体命令如下:
flutter channel dev
flutter upgrade

执行flutter channel dev出现的现象

如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

然后执行flutter upgrade出现的现象

如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

如何解决flutter upgrade可能会出现的问题

upgrade中可能会遇到running pub upgrade一直运行,无法进入下一步。
根据官网的提示: 官方中文网,需要配置国内镜像,具体如下:
1、计算机->属性->高级系统设置->环境变量->系统变量(s)-->直接点击新建,添加下面两个:
第一个:
PUB_HOSTED_URL
https://pub.flutter-io.cn

第二个
FLUTTER_STORAGE_BASE_URL
https://storage.flutter-io.cn

2、重启电脑
4、打开命令行,重新输入 flutter doctor,会自动升级

添加第一个的图
如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

添加第二个的图
如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

最后执行 flutter doctor

如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

如何解决:Android Studio (version 4.1); Flutter plugin not installed and Dart plugin not installed errors

上一篇:adb命令


下一篇:MySQL delete from where in 更新子句