none
unable to build RRS feed

  • Question

  • Hello,

    I am new to visual studio using cordova, I have been following https://docs.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/first-steps/build-your-first-app, I can build the app fine using browser based simulator but once I try to use google emulator I get following errors

    Command finished with error code 1: cmd /s /c "E:\ionicProjects\test\WeatherApp\WeatherApp\platforms\android\gradlew.bat cdvBuildDebug -b E:\ionicProjects\test\WeatherApp\WeatherApp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
    1>MSBUILD : cordova-build error : Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: zip file is empty
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.createDist(Install.java:47)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
    1>MSBUILD : cordova-build error : Caused by: java.util.zip.ZipException: zip file is empty
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.open(Native Method)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:219)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:163)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.unzip(Install.java:160)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.access$400(Install.java:29)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install$1.call(Install.java:70)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install$1.call(Install.java:47)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    1>MSBUILD : cordova-build error :  ... 3 more
    1>MSBUILD : cordova-build error : Error: cmd: Command failed with exit code 1 Error output:
    1>MSBUILD : cordova-build error : Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: zip file is empty
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.createDist(Install.java:47)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
    1>MSBUILD : cordova-build error : Caused by: java.util.zip.ZipException: zip file is empty
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.open(Native Method)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:219)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:149)
    1>MSBUILD : cordova-build error :  at java.util.zip.ZipFile.<init>(ZipFile.java:163)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.unzip(Install.java:160)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install.access$400(Install.java:29)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install$1.call(Install.java:70)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.Install$1.call(Install.java:47)
    1>MSBUILD : cordova-build error :  at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    1>MSBUILD : cordova-build error :  ... 3 more
    1>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M

    I am using visual studio 2017

    Any help is much appreciated

    Regards

    Yasir 

    Tuesday, March 14, 2017 8:54 AM

All replies

  • Hi,

    From the error log, the problem is the downloaded "gradle-<version>-all.zip" is broken or empty.

    You can try the following steps to fix the problem:

      1. Open Task Manager->end task "Java(TM) Platform SE binary".

      2. Redirect to  "C:\Users\<UserName>\.gradle\wrapper\dists\"->Delete folder "gradle-<version>-all".

      3. Open your project->run it with Google Emulator again. VS will download the "gradle-<version>-all.zip" for you, it will last for some time depending on your network.

    Best Regards,

    Elvis Xia

    Wednesday, March 15, 2017 9:19 AM