为了账号安全,请及时绑定邮箱和手机立即绑定

下载Gradle时离子生成Android错误

下载Gradle时离子生成Android错误

炎炎设计 2019-11-25 11:10:55
我对Ionic框架很陌生:)>npm install -g cordova>npm install -g ionic>ionic start test blank>cd test>ionic platform add android当我使用' >ionic build android'时,开始下载gradle,但无法下载并出现错误。是什么导致此错误,我该如何解决?我下载了Gradle并将其安装在PC上,但它想再次下载。我可以离线将Gradle添加到项目中吗?C:\Users\LENOVO2014\test>ionic build androidrunning cordova build androidRunning command: "C:\Program Files\nodejs\node.exe" C:\Users\LENOVO2014\myApp\hooks\after_prepare\010_add_platform_class.js C:\Users\LENOVO2014\myAppadd to body class: platform-androidRunning command: C:\Users\LENOVO2014\myApp\platforms\android\cordova\build.batANDROID_HOME=D:\program\Programing\Android\sdkJAVA_HOME=C:\Program Files\Java\jdk1.8.0_31Running: C:\Users\LENOVO2014\myApp\platforms\android\gradlew cdvBuildDebug -b C:\Users\LENOVO2014\myApp\platforms\android\build.gradle -Dorg.gradle.daemon=trueDownloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip............................................................................................................................................................................................................................................................................................Exception in thread "main" java.lang.RuntimeException: java.net.SocketException: Connection reset        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.net.SocketException: Connection reset        at java.net.SocketInputStream.read(SocketInputStream.java:189)        at java.net.SocketInputStream.read(SocketInputStream.java:121)        at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)        at sun.net.www.MeteredStream.read(MeteredStream.java:134)
查看完整描述

3 回答

?
慕田峪7331174

TA贡献1828条经验 获得超13个赞

由于上面发布的解决方案需要将.zip包含到大约55MB的文件夹中


您还可以通过以下命令强制CLI在构建过程中使用Ant而不是gradle:


cordova build android -- --ant


查看完整回答
反对 回复 2019-11-25
  • 3 回答
  • 0 关注
  • 470 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信