当我使用VS2015构建android,并开始下载gradle时,我的环境是behide corp proxy,我收到了如下错误。
在通过代理下载时是否设置了gradle代理?
------ Build configuration options: --debug
1> Running command: cmd "/s /c "C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\build.bat --debug --buildConfig=C:\@temp\BlankCordovaApp1\BlankCordovaApp1\build.json""
1> ANDROID_HOME=C:\@AppTool\android-sdk-windows
1> JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
1> Reading build config file: C:\@temp\BlankCordovaApp1\BlankCordovaApp1\build.json
1> Running: C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build.gradle -Dorg.gradle.daemon=true
1> Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
1>
1> Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
1> at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
1> at org.gradle.wrapper.Install.createDist(Install.java:47)
1> at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
1> at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
1> Caused by: java.net.ConnectException: Connection refused: connect
1> at java.net.DualStackPlainSocketImpl.connect0(Native Method)
1> at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
1> at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
1> at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
1> at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
1> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
1> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
1> at java.net.Socket.connect(Socket.java:589)
1> at java.net.Socket.connect(Socket.java:538)
1> at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
1> at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
1> at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
1> at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
1> at sun.net.www.http.HttpClient.New(HttpClient.java:308)
1> at sun.net.www.http.HttpClient.New(HttpClient.java:326)
1> at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1167)
1> at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1103)
1> at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:997)
1> at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:931)
1> at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
1> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
1> at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
1> at org.gradle.wrapper.Download.download(Download.java:45)
1> at org.gradle.wrapper.Install$1.call(Install.java:60)
1> at org.gradle.wrapper.Install$1.call(Install.java:47)
1> at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
1> ... 3 more
1>
1> C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\node_modules\q\q.js:126
1> throw e;
1> ^
1> Error code 1 for command: cmd with args: /s /c "C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\build.gradle -Dorg.gradle.daemon=true"
1> Command finished with error code 1: cmd /s /c "C:\@temp\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\build.bat --debug --buildConfig=C:\@temp\BlankCordovaApp1\BlankCordovaApp1\build.json"
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
答案 0 :(得分:0)
http://services.gradle.org目前无法供所有人使用,因此您的公司代理不是问题所在:http://downforeveryoneorjustme.com/services.gradle.org