2

I got an error while I build one of tasks. Even though I check the error message, I couldn't find solution to solve it. Could you help me?

The newly created daemon process has a different context than expected.
It won't be possible to reconnect to this daemon. Context mismatch:
At least one daemon option is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jdk1.6.0_35,daemonRegistryDir=C:\Users\Victoria.gradle\daemon,pid=2992,idleTimeout=null,daemonOpts=,-Dfile.encoding=x-windows-949]
Actual: DefaultDaemonContext[uid=787a77a8-0451-4958-a4dc-00338f345b2e,javaHome=C:\Program Files\Java\jdk1.6.0_35,daemonRegistryDir=C:\Users\Victoria.gradle\daemon,pid=1196,idleTimeout=60000,daemonOpts=-Dfile.encoding=x-windows-949]
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:168)
....
org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55) ....
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152)

Caused by: org.gradle.api.GradleException: The newly created daemon process has a different context than expected. It won't be possible to reconnect to this daemon. Context mismatch: At least one daemon option is different. Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jdk1.6.0_35,daemonRegistryDir=C:\Users\Victoria.gradle\daemon,pid=2992,idleTimeout=null,daemonOpts=,-Dfile.encoding=x-windows-949] Actual: DefaultDaemonContext[uid=787a77a8-0451-4958-a4dc-00338f345b2e,javaHome=C:\Program Files\Java\jdk1.6.0_35,daemonRegistryDir=C:\Users\Victoria.gradle\daemon,pid=1196,idleTimeout=60000,daemonOpts=-Dfile.encoding=x-windows-949]

at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:120)

Vic
  • 95
  • 1
  • 7

4 Answers4

2

I solved this problem by myself.

I changed JAVA_HOME path from jdk 1.7 to jdk 1.6.

Vic
  • 95
  • 1
  • 7
1

This error appear most likely downloading applications (such as Oracle, Application servers...) that include java version or installing another JDK/JRE.

I managed to solve the this problem by deleting/renaming all JDK/JRE and forders and only keep one and only one JDK folder and contains JRE folder inside.

also I put the JDK path into JAVA_HOME and path vatiables and remove any other JDK/JRE paths from the environment variables.

After that reset the JDK home in your Android Studio IDE.

Regards, Mohammed Kharma

0

The same problem was in my eclipse and I solved it in similar but more flexible way as:

You can have several JDK on your machine. To work with a particular JDK version in Eclipse, go to Window->Preferences->Gradle->Arguments

Select the radio button next to “Workspace JRE”. From the drop-down menu, select the appropriate JDK version.

If the JDK does not show up, add the JDK to your workspace by clicking "Configure JRE's" button, and then "Add"(if you know exact location) or "Search" button to find all JDK and JDE. Select JDK and hit "OK".

burseaner
  • 885
  • 2
  • 17
  • 28
0

In our case, there were multiple JAVA installations, 64bit and 32bit versions. Problem is solved by removed one of them and also setting JAVA_HOME variable in settings.

Murat
  • 3,084
  • 37
  • 55