ionic build android error when download gradle -
i'm new ionic framework :)
>npm install -g cordova >npm install -g ionic >ionic start test blank >cd test >ionic platform add android
when use '>ionic build android
' start download gradle, can't download , error
what caused error , how can fix it?!
i download gradle , install in pc wants download again. can add gradle project offline?
c:\users\lenovo2014\test>ionic build android running cordova build android running command: "c:\program files\nodejs\node.exe" c:\users\lenovo2014\myapp\ho oks\after_prepare\010_add_platform_class.js c:\users\lenovo2014\myapp add body class: platform-android running command: c:\users\lenovo2014\myapp\platforms\android\cordova\build.bat android_home=d:\program\programing\android\sdk java_home=c:\program files\java\jdk1.8.0_31 running: c:\users\lenovo2014\myapp\platforms\android\gradlew cdvbuilddebug -b c: \users\lenovo2014\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.net.socketexception: connection reset @ org.gradle.wrapper.exclusivefileaccessmanager.access(exclusivefileacc essmanager.java:78) @ org.gradle.wrapper.install.createdist(install.java:47) @ org.gradle.wrapper.wrapperexecutor.execute(wrapperexecutor.java:129) @ org.gradle.wrapper.gradlewrappermain.main(gradlewrappermain.java:48) caused by: java.net.socketexception: connection reset @ java.net.socketinputstream.read(socketinputstream.java:189) @ java.net.socketinputstream.read(socketinputstream.java:121) @ java.io.bufferedinputstream.read1(bufferedinputstream.java:284) @ java.io.bufferedinputstream.read(bufferedinputstream.java:345) @ sun.net.www.meteredstream.read(meteredstream.java:134) @ java.io.filterinputstream.read(filterinputstream.java:133) @ sun.net.www.protocol.http.httpurlconnection$httpinputstream.read(http urlconnection.java:3335) @ sun.net.www.protocol.http.httpurlconnection$httpinputstream.read(http urlconnection.java:3328) @ org.gradle.wrapper.download.downloadinternal(download.java:63) @ org.gradle.wrapper.download.download(download.java:45) @ org.gradle.wrapper.install$1.call(install.java:60) @ org.gradle.wrapper.install$1.call(install.java:47) @ org.gradle.wrapper.exclusivefileaccessmanager.access(exclusivefileacc essmanager.java:65) ... 3 more c:\users\lenovo2014\myapp\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ error code 1 command: cmd args: /s /c "c:\users\lenovo2014\myapp\platfo rms\android\gradlew cdvbuilddebug -b c:\users\lenovo2014\myapp\platforms\android \build.gradle -dorg.gradle.daemon=true" error building 1 of platforms: error: c:\users\lenovo2014\myapp\platforms\ android\cordova\build.bat: command failed exit code 1 may not have required environment or os build project error: c:\users\lenovo2014\myapp\platforms\android\cordova\build.bat: command fa iled exit code 1 @ childprocess.whendone (c:\users\lenovo2014\appdata\roaming\npm\node_modul es\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23) @ childprocess.emit (events.js:110:17) @ maybeclose (child_process.js:1015:16) @ process.childprocess._handle.onexit (child_process.js:1087:5)
i using ionic version 1.7.14 , distributionurl found in following file. myapp/platforms/android/cordova/lib/builders/gradlebuilder.js.
i had point locally downloaded gradle specified in answer.
i had same problem. added gradle project offline.
after downloading gradle issued link (here http://services.gradle.org/distributions/gradle-2.2.1-all.zip) paste in somewhere likes myapp\platforms\android\gradle\gradle-2.2.1-all.zip
, in build.js myapp\platforms\android\cordova\lib\build.js
find this:
var distributionurl = 'distributionurl=http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';
and replace own file's location:
var distributionurl = 'distributionurl=../gradle-2.2.1-all.zip';
Comments
Post a Comment