Gradle Build Problems


Hello everyone, so I’m trying to get a basic app going that is running off of Angular. I’ve built the basics, have the AVD working with the emulator, the emulator runs fine, and so far everything is going great. However, whenever I try to build the application everything works and green lights up until building gradle. Here is the stacktrace I’m getting with this:


  • Exception is:
    org.gradle.launcher.daemon.client.DaemonConnectionException: Could not dispatch a message to the daemon.
    at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(
    at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(
    at org.gradle.launcher.daemon.client.DaemonClientInputForwarder$ForwardTextStreamToConnection.endOfStream(
    at org.gradle.launcher.daemon.client.InputForwarder$
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(
    at org.gradle.internal.concurrent.StoppableExecutorImpl$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$
    Caused by: org.gradle.internal.remote.internal.MessageIOException: Could not write ‘/’.
    at org.gradle.internal.remote.internal.inet.SocketConnection.flush(
    at org.gradle.launcher.daemon.client.DaemonClientConnection.dispatch(
    … 8 more
    Caused by: An existing connection was forcibly closed by the remote host
    at Method)
    at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeWithNonBlockingRetry(
    at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.writeBufferToChannel(
    at org.gradle.internal.remote.internal.inet.SocketConnection$SocketOutputStream.flush(
    at org.gradle.internal.remote.internal.inet.SocketConnection.flush(
    … 9 more

I’ve deleted the .gradle folder in it’s entirety to check if there is a cache issue but to no avail. I’ve made sure to run this out of admin mode and in admin mode to try to see if it has to do with elevation rights but I get the same error on both fronts.


So as the error mentions, something is force-ably closing the connection. Further investigation lead me to turn off one of my anti-virus/malware tools, Malware-bytes. I’m not sure as to why it was killing the connections Gradle was trying to make - but it was. After closing that program it finally built correctly. I’m assuming that other anti-virus/malware programs could do the same thing. Here is something to help troubleshoot for people that have a similar issue in the future:

C:\Users\there\Desktop\PHPProjects\basicdrawer\platforms\android>gradlew build --status
No Gradle daemons are running.
15344 STOPPED (by user or operating system)
10156 STOPPED (by user or operating system)
5892 STOPPED (by user or operating system)
11144 STOPPED (by user or operating system)
17784 STOPPED (by user or operating system)
17312 STOPPED (by user or operating system)
18980 STOPPED (by user or operating system)
2204 STOPPED (by user or operating system)
12012 STOPPED (by user or operating system)
15568 STOPPED (by user or operating system)

Only Daemons for the current Gradle version are displayed. See


If everything is getting killed off there is something going on that is forceably doing so. Hope it helps.