Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48398

[Ionic + Cordova + Gradle + Android + Jenkins on Windows] Build failed with the pipe is being closed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Blocker Blocker
    • batch-task-plugin
    • None

      I try to build ionic project under Jenkings on Windows. Suppose nodejs/npm/cordova/ionic installed (how to install ionic/cordova https://ionicframework.com/docs/intro/installation/ ). I created the jenkins item with free configuration and run the following windows batch:

       

      set ANDROID_HOME=C:\android\sdk
       set NODEJS_HOME=C:\nodejs
       set NPM_HOME=%NODEJS_HOME%\npmroot
       set CI=true
       set PATH=%SystemRoot%\system32;%SystemRoot%
       set PATH=%JAVA_HOME%\bin;%PATH%
       set PATH=%NODEJS_HOME%;%PATH%
       set PATH=%NPM_HOME%;%PATH%
       set PATH=%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%ANDROID_HOME%\tools\bin;%PATH%
       set BUILD_DIR=%WORKSPACE%\..\builds%BUILD_ID%\build
       mkdir %BUILD_DIR%
       cd %BUILD_DIR%
       call ionic start latest sidemenu
       cd latest
       call npm install
       call ionic cordova plugin add cordova-plugin-file-transfer
       call ionic cordova plugin add cordova-sqlite-storage
       call ionic cordova plugin add cordova-plugin-advanced-http
       call ionic cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=myapp --variable DEEPLINK_SCHEME=https --variable DEEPLINK_HOST=example.com --variable ANDROID_PATH_PREFIX=/
       call ionic cordova plugin add cordova-plugin-pin-dialog
       call ionic cordova plugin add cordova-plugin-crosswalk-webview
       call ionic cordova platform add android
       rem also I tried to set android.aaptOptions.useNewCruncher=true in build-extras.gradle but it does not help
       rem echo android.aaptOptions.useNewCruncher=true >platforms\android\build-extras.gradle
       rem also I tried to set cdvBuildToolsVersion with different build-tools, it does not help
       rem echo cdvBuildToolsVersion=25 >platforms\android\gradle.properties 
       call ionic cordova build android -prod --release – --gradleArg=-info
       
      

      but the build failed from time to time with:

       

       
      What went wrong:
      Execution failed for task ':mergeArmv7ReleaseResources'.
       > Error: java.util.concurrent.ExecutionException: java.io.IOException: The pipe is being closed   Try:
       Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
      BUILD FAILED
      Total time: 4.296 secs
       Stopped 0 worker daemon(s).
       Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':mergeArmv7ReleaseResources'.] from daemon DaemonInfo{pid=8240, address=[cef53d36-8cae-4993-8efb-7f9a4d217241 port:52098, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1512517318653, context=DefaultDaemonContext[uid=2d744783-e87e-4dae-b50a-728ff0821338,javaHome=C:\Program Files\Java\jdk1.8.0_151,daemonRegistryDir=C:\Windows\System32\config\systemprofile\.gradle\daemon,pid=8240,idleTimeout=10800000,daemonOpts=-Xmx2048m,-Dfile.encoding=windows-1251,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
       Error: cmd: Command failed with exit code 1 Error output:
       Note: Some input files use or override a deprecated API.
       Note: Recompile with -Xlint:deprecation for details.
       Note: Some input files use or override a deprecated API.
       Note: Recompile with -Xlint:deprecation for details.
       Thread(png-cruncher_6): The pipe is being closed
       java.io.IOException: The pipe is being closed
       at java.io.FileOutputStream.writeBytes(Native Method)
       at java.io.FileOutputStream.write(FileOutputStream.java:326)
       at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
       at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
       at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
       at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
       at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
       at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
       at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:151)
       at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
       at java.lang.Thread.run(Thread.java:748)
       Thread(png-cruncher_17): The pipe is being closed
       java.io.IOException: The pipe is being closed
       at java.io.FileOutputStream.writeBytes(Native Method)
       at java.io.FileOutputStream.write(FileOutputStream.java:326)
       at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
       at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
       at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
       at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
       at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
       at com.android.builder.png.AaptProcess.shutdown(AaptProcess.java:143)
       at com.android.builder.png.QueuedCruncher$1.destruction(QueuedCruncher.java:151)
       at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:245)
       at java.lang.Thread.run(Thread.java:748)
       Thread(png-cruncher_2): The pipe is being closed
      

       

      Here is full log: https://pastebin.com/WBkZCipg

      Thanks in advance for any hints and help!

      BR,
      Anatoly Shirokov

       

            kohsuke Kohsuke Kawaguchi
            anatolys Anatoly Shirokov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: