以下是學(xué)習(xí)過程中爬過的坑,以及解決方案:(此刻開始吧)
編譯環(huán)境:
1. 打開終端去根目錄:cd ~
2. 打開bash_profile:open -e .bash_profile
3. 如果沒有就創(chuàng)建:touch ~/.bash_profile,接著再打開
4. 編輯bash_profile:
5. // Flutter SDK路徑 (放在應(yīng)用程序中,或者文檔,不容易刪除丟失的路徑即可)
export PATH=/Users/用戶名//Applications/flutter/flutter/bin:$PATH
// 由于眾所周知的原因,需要設(shè)置鏡像路徑
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=[https://storage.flutter-io.cn]
6.保存關(guān)閉,終端運(yùn)行bash_profile:source $HOME/.bash_profile
環(huán)境配置問題解決方案:
描述:在配置好環(huán)境變量,下次使用時(shí)配置失效處理如下處理。
1.終端添加環(huán)境變量
vim ~/.bash_profile
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
flutter安裝 目錄:export PATH=/Users/xxxxxxx/Documents/Development/flutter/bin:$PATH
保存之后,終端運(yùn)行:source $HOME/.bash_profile
在運(yùn)行: flutter doctor? ?
?搞定。