Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build failing after update

Getting exception while gradle/gradlew build. Build without test cases is successful. This happening when I updated the gradle to 6.0.1

Works fine for gradle 5.6/6.2 version.

Could not write standard input to Gradle Test Executor 2.
java.io.IOException: The pipe is being closed
 at java.base/java.io.FileOutputStream.writeBytes(Native Method)
 at java.base/java.io.FileOutputStream.write(FileOutputStream.java:348)
 at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
 at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
 at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:68)
 at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
 at java.base/java.lang.Thread.run(Thread.java:835)
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain

FAILURE: Build failed with an exception.
like image 289
Vivek Kamat Avatar asked Feb 25 '20 03:02

Vivek Kamat


People also ask

Why is my Gradle build failing?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.


1 Answers

I just had this happen, and found that stopping the gradle daemon resolved it for me:

gradle --stop

or

./gradlew --stop

depending on your setup (the daemon is relaunched when you attempt to build again).

like image 86
Crwth Avatar answered Sep 20 '22 19:09

Crwth