Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
580 views
in Technique[技术] by (71.8m points)

cordova - ionic build android error

I'm confused. jdk,sdk,ant,cordova,ionic doing well,why builds error?
I searched everywhere,but no answer for it.
I guess has a error version?
who can help this?

system:win8
jdk:1.8
ant:1.96
android:22

%ANT_HOME%in;%ANDROID_HOME%platform-tools;%ANDROID_HOME%ools;%java_home%in;%java_home%jrein;C:ProgramDataOracleJavajavapath;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Program Files
odejs

Path

E:ionicdemo22>ionic build android
Running command: "C:Program Files
odejs
ode.exe" E:ionicdemo22hooksafter_
prepare10_add_platform_class.js E:ionicdemo22
add to body class: platform-android
Running command: cmd "/s /c "E:ionicdemo22platformsandroidcordovauild.bat
""
ANDROID_HOME=E:adt-bundle-windows-x86_64-20140702sdk
JAVA_HOME=C:Program FilesJavajdk1.8.0_60
Running: E:ionicdemo22platformsandroidgradlew cdvBuildDebug -b E:ionicdem
o22platformsandroiduild.gradle -Dorg.gradle.daemon=true
Unzipping C:Userscxt.gradlewrapperdistsgradle-2.2.1-all2m8005s69iu8v0oiej
fej094bgradle-2.2.1-all.zip to C:Userscxt.gradlewrapperdistsgradle-2.2.1-
all2m8005s69iu8v0oiejfej094b
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio
n: error in opening zip file
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.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.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:219)
        at java.util.zip.ZipFile.<init>(ZipFile.java:149)
        at java.util.zip.ZipFile.<init>(ZipFile.java:163)
        at org.gradle.wrapper.Install.unzip(Install.java:160)
        at org.gradle.wrapper.Install.access$400(Install.java:29)
        at org.gradle.wrapper.Install$1.call(Install.java:70)
        at org.gradle.wrapper.Install$1.call(Install.java:47)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
        ... 3 more

E:ionicdemo22platformsandroidcordova
ode_modulesqq.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "E:ionicdemo22platformsandroi
dgradlew cdvBuildDebug -b E:ionicdemo22platformsandroiduild.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
    at ChildProcess.whenDone (C:UserscxtAppDataRoaming
pm
ode_modulescord
ova
ode_modulescordova-libsrccordovasuperspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Error

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I hope that not too late, but I had the same error and. So, I fixed it doing the next:

In your case find this:

C:Userscxt.gradlewrapperdistsgradle-2.2.1- all2m8005s69iu8v0oiejfej094b

now you are here to delete the gradle-2.2.1-all.zip because this file is corrupted and then replace the file with this http://services.gradle.org/distributions/gradle-2.2.1-all.zip when you finish all try again

ionic build android

Good Luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...