Gradle Build failed unity 2020.3.14. incompatible daemon, commandInvocationFailure
I bought a new laptop. I've just installed Unity 2020.3.14f1. Installed the Android Studio for SDK, installed JDK and NDK too. Also downloaded the Gradle file. Set all the paths in unity. Then I tried to compile a game that I previously built in an older unity version, But this time it failed to build the game. When all the build process is almost completed, it hangs for a while and then throws an error "Gradle build failed, see console for details".
This is the console:
ERRORS: 1) Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details. 2) Picked up JAVA_TOOL_OPTIONS: Dfile.encoding=UTF-8. 3) CommandInvocationFailure: Gradle build failed. 4) Build completed with a result of "failed" in 230 seconds
Actually, I really don't understand these SDK JDK or Gradle things.
Can anyone please help me with Building my Game? I'm in a really huge headache with this.
Please Help.
I'm still having this issue. I've tried manually installing android studio, Gradle, and JDK. I've also tried to do a dev build as well, I tried deleting all of my Unity builds and re-installing, still failing. I thought maybe it had something to do with my specific project, so I even created a new blank project, and even then the build failed.
I can't find a solution anywhere and I'm not sure what else to try. :/
Answer by alevjen · Aug 28, 2021 at 01:02 AM
Getting the same error! Really not finding any solutions
My problem was solved. I just uninstalled unity completely and installed again. I downloaded android support tools from the unity hub. All works fine now
You have discord to explain me , because i have the same errors , and i dont understand This is my Discord ❦BlackMortymer❦#2227
I finally managed to fix this by making sure my gradle version is the recommended (6.8).
Before I had the latest version which did not work!
Answer by shacharoz · Oct 10, 2021 at 07:01 PM
making one dev build seems to solve it. then go back to release.
if that did not work, try:
mark anything automatic, no custom gradle build etc.
in unity hub, make sure your unity editors are installed on a path on C: rather than inside Program Files. the space in the middle, as well as the length of the path to the project files, might affect that as well.
then I also installed manually the next android SDK versions.
Answer by shahnawazhussain2802 · Jan 11 at 05:49 PM
Thank you so much @alevjen , @shacharoz and @nikunjsth5 . All thanks but my problem was solved by completely uninstalling and then reinstalling unity and downloading the android support from unity hub. This solved my problem. Again thanks all for answering. Cheers!
Answer by nikunjsth5 · Jan 11 at 02:10 PM
Just tick the "gradle installed in unity" option in preferences->external tools. It worked for me
Answer by hasnainkt57 · Mar 29 at 02:53 PM
go to edit>preferences >External tools> and un check (Stop gradle daemons on exit) it will fix the problem.