Flutter 踩坑:Proxy Configuration ! NO_PROXY is not set

Mac 更新系統(tǒng)(10.15.4)以后 cocopod 不好用了 ,連累 Flutter 項目也遇到問題。

運行 flutter docter,提示需要重新安裝 cocopod:

Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.4
    19E287, locale zh-Hans-CN)
 
[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Xcode - develop for iOS and macOS (Xcode 11.4)
    ? CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is different from
        the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see
        https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
[?] Android Studio (version 3.6)
[?] VS Code (version 1.44.2)
[?] Connected device (2 available)

! Doctor found issues in 1 category.
?  flutter git:(stable) ? 

按照提示運行 sudo gem install cocoapods,重新安裝 cocopod 成功以后,再次運行 flutter docter:

?  flutter git:(stable) ? flutter doctor                                                                   
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.4 19E287, locale zh-Hans-CN)
 
[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[?] Xcode - develop for iOS and macOS (Xcode 11.4)
[?] Android Studio (version 3.6)
[?] VS Code (version 1.44.2)
[!] Proxy Configuration
    ! NO_PROXY is not set
[?] Connected device (2 available)

! Doctor found issues in 1 category.

又提示 Proxy 配置問題,[!] Proxy Configuration ! NO_PROXY is not set,搜了一下按照這個 issue:https://github.com/flutter/flutter/issues/41034 增加
export NO_PROXY=localhost,127.0.0.1 這一行到 bash_profile 文件就好了。

我手動添加到 bash_profile 最后一行:

Snip20200426_2.png

保存成功以后再次運行 flutter doctor,問題解決。

?  ~ flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.4 19E287, locale zh-Hans-CN)
[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[?] Xcode - develop for iOS and macOS (Xcode 11.4)
[?] Android Studio (version 3.6)
[?] VS Code (version 1.44.2)
[?] Proxy Configuration
[?] Connected device (2 available)

? No issues found!
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容