我对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
添加回答
举报
0/150
提交
取消