Gradle build is failing without any error message

Answered

Intellij version 2020.2

Installed Gradle version 6.8.1

When importing a gradle project from source the build is failing without any error message

0
8 comments

Please share the logs: Help | Collect Logs and Diagnostic Data.

You can upload the file at https://uploads.jetbrains.com and provide the ID here.

0

Serge Baranov I have uploaded the log file and here is the id 2021_02_01_W5ULUp8kHGJrhMXf (file: idea.log)

0
Caused by: org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/Users/ajith/.sdkman/candidates/java/current,daemonRegistryDir=/Users/ajith/.gradle/daemon,pid=45348,idleTimeout=null,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=GB,-Duser.language=en,-Duser.variant]
Actual: DefaultDaemonContext[uid=06c045c9-c385-4abd-b1ec-1477df4d9dbe,javaHome=/Users/ajith/.sdkman/candidates/java/11.0.8-zulu/zulu-11.jdk/Contents/Home,daemonRegistryDir=/Users/ajith/.gradle/daemon,pid=68399,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=GB,-Duser.language=en,-Duser.variant]

See https://stackoverflow.com/a/61806948/104891 for the solution.

See also https://youtrack.jetbrains.com/issue/IDEA-239878 .

0

Thanks. switching from zulu 11 jdk to openjdk 8 solved the issue

0

Serge Baranov

I have the similar problem,

IntelliJ IDEA 2021.3 (Ultimate Edition)
Gradle 6.8.3
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

I found the log

Wanted: DefaultDaemonContext[uid=null,
javaHome=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home,
Actual: DefaultDaemonContext[uid=8e29b520-5b1b-47d9-b4db-8aa96ecb4bcb,
javaHome=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/zulu-11.jdk/Contents/Home

I don't know what do I suppose to do with this.

The settings seems ok.

0

I've solved this problem by using another mac arm jdk. https://bell-sw.com/pages/downloads/#/java-11-lts 

And, this also helps https://stackoverflow.com/a/68160268 , if someone need it.

0

Serge Baranov

I have same problem. I can't sync gradle without error.

Upload id: 2024_02_02_7RTCsSCBmGtxjLciKGyLCN (file: idea-logs-20240202-09295012562581647601041664.zip)

0

Please sign in to leave a comment.