运行flutter doctor报错,如下:
A network error occurred while checking "https://maven.google.com/":
Operation timed out
主要原因是Google采用了自己的maven地址。
源文件位置:
$which flutter (确定flutter的位置)
cd ${flutter_sdk}/flutter
可以使用VS Code打开上面的所有文件,全局搜索 maven.google关键字
将原来的地址替换成 'https://dl.google.com/dl/android/maven2'
还有关键的一步,需要删除掉flutter运行工具的缓存文件。
cd ${flutter_sdk}/bin/cache/flutter_tools.snapshot
重新运行 flutter doctor 即可