美文网首页
Flutter 踩坑:Proxy Configuration !

Flutter 踩坑:Proxy Configuration !

作者: 九九丸子 | 来源:发表于2020-04-26 12:13 被阅读0次

    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!
    

    相关文章

      网友评论

          本文标题:Flutter 踩坑:Proxy Configuration !

          本文链接:https://www.haomeiwen.com/subject/yhydwhtx.html