3

I've just got my new windows 10 PC and I am trying to install Cordova/Phonegap but I am facing some problem.

I did the next steps:

  1. installed java C:\Program Files\Java\jdk1.8.0_65
  2. installed nodejs C:\Program Files\nodejs
  3. installed Android studio C:\Android\sdk (here the SDK MANAGER)
  4. installed GIT
  5. installed ANT C:\apache-ant-1.9.6
  6. installed Cordova/phonegap (npm install -g cordova)

On the windows variable environment I set:

User Variable - PATH = C:\Users\Shai\AppData\Roaming\npm;C:\apache-ant-1.9.6\bin;C:\Android\sdk\tools;C:\Android\sdk\platform-tools;C:\Program Files\nodejs

SYSTEM Variable - ANDROID_HOME = C:\Android\sdk
ANDROID_PLATFORM_TOOLS = C:\Android\sdk\platform-tools
ANT_HOME = C:\apache-ant-1.9.6

now when I creating a new project using:

cordova create hello com.example.hello HelloWorld

everything is good, next I do:

cordova platform add android

and that also works fine but the next command fails:

cordova build

I get the next error:

C:\app_workspace\hello>cordova build Running command: cmd "/s /c "C:\app_workspace\hello\platforms\android\cordova\build.bat"" ANDROID_HOME=C:\Android\sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65 Running: C:\app_workspace\hello\platforms\android\gradlew cdvBuildDebug -b C:\app_workspace\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true Unzipping C:\Users\Shai Mor Yosef.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b\gradle-2.2.1-all.zip to C:\Users\Shai Mor Yosef.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file 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.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:219) at java.util.zip.ZipFile.(ZipFile.java:149) at java.util.zip.ZipFile.(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(ExclusiveFileAccessManager.java:65) ... 3 more

C:\app_workspace\hello\platforms\android\cordova\node_modules\q\q.js:126 throw e; ^ Error code 1 for command: cmd with args: /s /c "C:\app_workspace\hello\platforms\android\gradlew cdvBuildDebug -b C:\app_workspace\hello\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

user2678018
  • 377
  • 2
  • 3
  • 11

0 Answers0