服务器返回HTTP响应代码503

时间:2016-01-27 10:49:50

标签: java android cordova

尝试使用node建立cordova时出现此错误。我已经落后于代理,而且我已经做好了准备。这是截图。我错过了什么。

JAVA_HOME=C:\Program Files\java\jdk1.8.0_71 
Running: C:\xampp\htdocs\MyApp\platforms\android\gradlew cdvBuildRelease 
-b C:\xampp\htdocs\MyApp\platforms\android\build.gradle 
-Dorg.gradle.daemon=true 
Downloading http:// services. gradle. org/distributions/gradle-2.2.1-all.zip 
Exception in thread "main" java.lang.RuntimeException: 
    java.io.IOException: Server returned HTTP response code: 503 for URL: http:// services.gradle. org/distributions/gradle-2.2.1-all.zip
 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
 at org.gradle.wrapper.Install.createDist(Install.java:47)
 at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
 at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48) 
Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://services. gradle. org/distributions/gradle-2.2.1-all.zip
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
 at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
 at org.gradle.wrapper.Download.download(Download.java:45)
 at org.gradle.wrapper.Install$1.call(Install.java:60)
 at org.gradle.wrapper.Install$1.call(Install.java:47)
 at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more C:\xampp\htdocs\MyApp\platforms\android\cordova\node_modules\q\q.js:126 throw e; 
^ Error code 1 for command: cmd with args: /s /c "C:\xampp\htdocs\MyApp\platforms\android\gradlew cdvBuildRelease 
-b C:\xampp\htdocs\MyApp\platforms\android\build.gradle 
-Dorg.gradle.daemon=true" 
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1 You may not have the required environment or OS to build this project 
Error: cmd: Command failed with exit code 1

1 个答案:

答案 0 :(得分:0)

找到解决方案。您可以选择1或2

  1. http://services.gradle.org/distributions/gradle-2.2.1-all.zip下载gradle并将其粘贴到App \ platforms \ android \ gradle和App \ platforms \ android \ cordova \ lib中的编辑build.js并更改var distributionUrl =' distributionUrl = HTTP \://services.gradle.org/distributions/gradle-2.2.1-all.zip' ;; to var distributionUrl =' distributionUrl = .. / gradle-2.2.1-all.zip';
  2. 更改var distributionUrl =' distributionUrl = http \://services.gradle.org/distributions/gradle-2.2.1-all.zip' ;; to var distributionUrl =' http://services.gradle.org/distributions/gradle-2.2.1-all.zip';