Flutter SDK
Flutter SDK
的方式有兩種:Flutter
官網下載Flutter github
項目下去下載安裝包
flutter doctor
(1)坑1git
Error: The Flutter directory is not a clone of the GitHub project. The flutter tool requires Git in order to operate properly; to set up Flutter, run the following command: git clone -b beta https://github.com/flutter/flutter.git
把剛剛下載的Flutter
安裝包刪掉,從新在想要安裝的目錄下運行git clone -b beta https://github.com/flutter/flutter.git
github
(2)坑2windows
報錯
從新運行flutter doctor
,這個時候又給我報錯說:網絡
此時不該有 \flutter\bin\cache
網上找了一下都沒有說報這個錯誤的,而後想起官網有句話說:ui
將安裝包zip解壓到你想安裝Flutter SDK的路徑(如:C:\src\flutter;注意,不要將flutter安裝到須要一些高權限的路徑如C:\Program Files\)。
發現我是將clone
下來的項目放在了D:\Program Files (x86)
下了,因此spa
【提示】這裏注意下,若是你的Flutter
的安裝目錄改變了,記得去更改它的環境變量的路徑。而後重啓電腦,再運行flutter doctor
。code
(3)坑3blog
這裏通常是網絡問題,確保是否更新了環境變量ip