macos - Flutter 在代理 : Proxy failed to establish tunnel (407 Proxy Authentication Required) 后面失败

标签 macos dart flutter

我刚刚开始设置 Flutter 以在我的 Mac 上运行。我在公司代理后面运行,每次我尝试运行flutter create app我在看 pub get failed .

我已经在我的 bash 配置文件中正确设置了我的代理设置:

export HTTP_PROXY="http://[myUsername]:[myPassword]@[myProxy]:[myPort]"
export HTTPS_PROXY=$HTTP_PROXY
export ALL_PROXY=$HTTP_PROXY
export http_proxy=$HTTP_PROXY
export https_proxy=$HTTP_PROXY
export all_proxy=$HTTP_PROXY
export GRPC_PROXY_EXP=$HTTP_PROXY
export grpc_proxy_exp=$HTTP_PROXY
export NO_PROXY=localhost,126.0.0.0,127.0.0.1
export STRICT_SSL=false
export strict_ssl=$STRICT_SSL
export NODE_TLS_REJECT_UNAUTHORIZED=0
export node_tls_reject_unauthorized=$NODE_TLS_REJECT_UNAUTHORIZED

运行 flutter doctor我看到我的代理设置正确:
✓] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is localhost,126.0.0.0,127.0.0.1
    • NO_PROXY contains 127.0.0.1
    • NO_PROXY contains localhost

查看 Github 问题,我看到其他人遇到了 the exact same problems但没有看到任何解决方案。

我目前的错误:
Proxy failed to establish tunnel (407 Proxy Authentication Required)    
package:pub/src/source/hosted.dart 349:7                                BoundHostedSource._throwFriendlyError
package:pub/src/source/hosted.dart 150:7                                BoundHostedSource.doGetVersions
===== asynchronous gap ===========================                      
package:pub/src/source.dart 167:12                                      BoundSource.getVersions
package:pub/src/solver/package_lister.dart 76:44                        PackageLister._versions.<fn>.<fn>
dart:async                                                              runZoned
package:pub/src/http.dart 272:10                                        withDependencyType
package:pub/src/solver/package_lister.dart 75:33                        PackageLister._versions.<fn>
===== asynchronous gap ===========================                      
dart:async                                                              new Future.sync
package:async/src/async_memoizer.dart 43:42                             AsyncMemoizer.runOnce
package:pub/src/solver/package_lister.dart 74:58                        PackageLister._versions
package:pub/src/solver/package_lister.dart 111:21                       PackageLister.countVersions
===== asynchronous gap ===========================                      
package:pub/src/solver/version_solver.dart 354:44                       VersionSolver._choosePackageVersion.<fn>
===== asynchronous gap ===========================                      
package:pub/src/utils.dart 301:39                                       minByAsync
===== asynchronous gap ===========================                      
package:pub/src/solver/version_solver.dart 350:25                       VersionSolver._choosePackageVersion
===== asynchronous gap ===========================                      
package:pub/src/solver/version_solver.dart 97:22                        VersionSolver.solve
===== asynchronous gap ===========================                      
package:pub/src/solver.dart 35:10                                       resolveVersions.<fn>
package:pub/src/log.dart 378:18                                         progress
package:pub/src/solver.dart 32:10                                       resolveVersions
package:pub/src/entrypoint.dart 203:24                                  Entrypoint.acquireDependencies
===== asynchronous gap ===========================                      
package:pub/src/command/get.dart 41:23                                  GetCommand.run
package:args/command_runner.dart 194:27                                 CommandRunner.runCommand
===== asynchronous gap ===========================                      
package:pub/src/command_runner.dart 171:39                              PubCommandRunner.runCommand.<fn>
dart:async                                                              new Future.sync
package:pub/src/utils.dart 109:12                                       captureErrors.<fn>
dart:async                                                              runZoned
package:pub/src/utils.dart 126:5                                        captureErrors
package:pub/src/command_runner.dart 171:13                              PubCommandRunner.runCommand
===== asynchronous gap ===========================                      
package:pub/src/command_runner.dart 119:11                              PubCommandRunner.run
===== asynchronous gap ===========================                      
/b/s/w/ir/k/src/third_party/dart/third_party/pkg/pub/bin/pub.dart 8:22  main
This is an unexpected error. Please run                                 

    pub --trace '--verbosity=warning' get --no-precompile               

and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
Running "flutter packages get" in my_app...                             
pub get failed (1)

我刚刚开始使用 Flutter,我不确定这是否与 Flutter 或 Dart 相关。

最佳答案

添加 https://pub.dartlang.org到你的代理规则,我用这个修复它

关于macos - Flutter 在代理 : Proxy failed to establish tunnel (407 Proxy Authentication Required) 后面失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56138235/

相关文章:

c++ - 如何在 C++ 中确定进程所有者是否是 Mac OS X 上的管理员

macos - OSX BLE 广告数据格式

android - 如何使用 Flutter 从 Firebase 获取当前活跃用户?

flutter - 不能将参数类型 'jsObject'分配给 'buildContext'参数?

mysql - 从 macOS 卸载 MySQL

html - Dart 中的动态表 : tbody td's don't align with thead td's

flutter - Flutter中LinearPercentIndicator的不同progressColor

flutter - 如何使用仅包含键的项列表创建新变量

class - 可选参数的默认值必须是常量 flutter/dart

xcode - Mac 应用程序的设计 View