错误完成:ProcessException:进程“ D:\ flutter_projects \ first_app \ android \ gradlew.bat”异常退出(连接被拒绝:connect)

时间:2019-04-29 22:12:43

标签: gradle flutter

我看到了另一个标题相同的问题,但是这个问题有不同的根本原因,因为这是与在公司代理下使用网络有关的问题:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Finished with error: ProcessException: Process "D:\flutter_projects\first_app\android\gradlew.bat" exited abnormally:
Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip


    Exception in thread "main" java.net.ConnectException: Connection refused: connect
// a lot of lines....
      Command: D:\flutter_projects\first_app\android\gradlew.bat -v

我也看到了一个与公司防火墙有关的问题:https://www.dartlang.org/tools/pub/troubleshoot#pub-get-fails-from-behind-a-corporate-firewall。在这种情况下,我已经像上面的教程中一样应用了命令,并且“ flutter create app”命令运行正常。

问题是因为尝试下载与Gradle相关的内容时,我的公司网络拒绝连接,因此我没有找到基于这些问题的任何解决方案。当我运行“ flutter run”时,它总是相同的:

Flutter crash report; please file at https://github.com/flutter/flutter/issues.
## command

flutter run

## exception

ProcessException: ProcessException: Process "D:\flutter_projects\first_app\android\gradlew.bat" exited abnormally:
Downloading https://services.gradle.org/distributions/gradle-4.10.2-all.zip
Exception in thread "main" java.net.ConnectException: Connection refused: connect

我已经运行了“ flutter doctor”命令,但看起来还可以

我发现的另一件事是,当我尝试运行命令“ flutter run”时,出现以下消息:

Initializing gradle...                                                 \
Oops; flutter has exited unexpectedly.          Sending crash report to Google.
Failed to send crash report due to a network error: SocketException: OS Error: O computador remoto recusou a conexão de
rede.
, errno = 1225, address = clients2.google.com, port = 54951

因此,我真的知道这些错误是由于我的公司网络限制所致,但是我想知道如何解决此问题。我的操作系统是Windows10。谢谢

0 个答案:

没有答案