在安装flutter时,前面所有流程都按照官方的走,但是在执行 flutter doctor时,出现2个错误
1、提示需要安装cocoapods
2、提示需要安装 android studio
安装cocoapods是通过brew 来安装的
但是安装brew 时,按照官方给定的shell脚本是不行的,提示:
Failed to connect to raw.githubusercontent.com port 443: Connection refused
只有通过下载安装,下载安装 brew后,执行
sudo brew install cocoapods 时,又遇到:
··· Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system. ···
这个错误,找了半天,没解决。
最后直接使用 brew install cocoapods 时正确了。
如果使用 brew install cocoapods如果也不行,可以先使用:
brew doctor
然后,再执行:brew install cocoapods
正常就可以安装成功了,安装成功后,安装android studio
安装成功后,需要在preferences -> System setting -> android sdk -> skd tools -> 勾选 commad too line