Flutter 踩坑:Proxy Configuration ! NO_PROXY is not set

Mac 更新系统(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!
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容