I use Intellij Idea 13.1.1 and I get GradleConnectionException while building:
Error:org.gradle.tooling.GradleConnectionException:
Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.:
Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.
I've seen similar question here and googled it. But it didn't help me.
In the end I found Idea's buld log and this is the exception with more details from there (sorry for very long log, but it's just for more detailed information):
2014-06-04 10:41:20,732 [ 0] INFO - jps.cmdline.JpsModelLoaderImpl - Loading model: project path = <PATH_TO_MY_PROJECT>, global options path = C:/Users/<USER_NAME>/.IdeaIC13/config/options
2014-06-04 10:41:21,404 [ 672] INFO - jps.cmdline.JpsModelLoaderImpl - Model loaded in 673 ms
2014-06-04 10:41:21,404 [ 672] INFO - jps.cmdline.JpsModelLoaderImpl - Project has 3 modules, 14 libraries
2014-06-04 10:41:21,643 [ 911] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; max=688586752
2014-06-04 10:41:22,288 [ 1556] INFO - .incremental.IncProjectBuilder - Building project; isRebuild:false; isMake:true parallel compilation:false
2014-06-04 10:41:22,292 [ 1560] INFO - r.api.ClassFilesIndicesBuilder - class files data index disabled
2014-06-04 10:41:22,329 [ 1597] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
2014-06-04 10:41:22,456 [ 1724] INFO - der.AndroidGradleTargetBuilder - Using execution settings: BuilderExecutionSettings[embeddedGradleDaemonEnabled=false, buildMode=SOURCE_GEN, gradleDaemonMaxIdleTimeInMs=60000, gradleDaemonCommandLineOptions=[], gradleDaemonJvmOptions=[], gradleHomeDir=C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10, gradleServiceDir=null, javaHomeDir=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.1\jre\jre, offlineBuild=false, parallelBuild=false, projectDir=<PATH_TO_MY_PROJECT>, verboseLoggingEnabled=false, modulesToBuildNames=[<PROJECT_NAME>, <PROJECT_NAME>-<PROJECT_NAME>, <PROJECT_NAME_SAMPLE>]]
2014-06-04 10:41:22,458 [ 1726] INFO - der.AndroidGradleTargetBuilder - Gradle build using tasks: [:<PROJECT_NAME>:generateDebugSources, :<PROJECT_NAME_SAMPLE>:generateDebugSources]
2014-06-04 10:41:22,460 [ 1728] INFO - der.AndroidGradleTargetBuilder - About to build project '<PROJECT_NAME>' located at <PATH_TO_MY_PROJECT>
2014-06-04 10:41:22,537 [ 1805] INFO - der.AndroidGradleTargetBuilder - Passing JVM args to Gradle Tooling API: [-Dandroid.home=C:\adt-bundle-windows-x86_64-20131030\sdk]
2014-06-04 10:41:24,934 [ 4202] INFO - .incremental.IncProjectBuilder - org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.
org.jetbrains.jps.incremental.ProjectBuildException: org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:877)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:772)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:595)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:224)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle installation 'C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:67)
at com.android.tools.idea.jps.builder.AndroidGradleTargetBuilder.doBuild(AndroidGradleTargetBuilder.java:331)
at com.android.tools.idea.jps.builder.AndroidGradleTargetBuilder.build(AndroidGradleTargetBuilder.java:131)
at com.android.tools.idea.jps.builder.AndroidGradleTargetBuilder.build(AndroidGradleTargetBuilder.java:76)
at org.jetbrains.jps.incremental.BuildOperations.buildTarget(BuildOperations.java:101)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:819)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:857)
... 14 more
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=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.1\jre\jre,daemonRegistryDir=C:\Users\<USER_NAME>\.gradle\daemon,pid=1644,idleTimeout=null,daemonOpts=-Dfile.encoding=windows-1251]
Actual: DefaultDaemonContext[uid=bb72a914-1081-4f81-a9b1-67c8d0a9106d,javaHome=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.1\jre,daemonRegistryDir=C:\Users\<USER_NAME>\.gradle\daemon,pid=5592,idleTimeout=60000,daemonOpts=-Dfile.encoding=windows-1251]
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connectToDaemonWithId(DefaultDaemonConnector.java:119)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.startDaemon(DefaultDaemonConnector.java:99)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:72)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:149)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:74)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:42)
at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:53)
at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:30)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:106)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:93)
at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:133)
at org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedModelProducer.produceModel(ModelBuilderBackedModelProducer.java:44)
at org.gradle.tooling.internal.consumer.connection.GradleBuildAdapterProducer.produceModel(GradleBuildAdapterProducer.java:42)
at org.gradle.tooling.internal.consumer.connection.ModelBuilderBackedConsumerConnection.run(ModelBuilderBackedConsumerConnection.java:50)
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:77)
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:71)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:82)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.connection.LoggingInitializerConsumerActionExecutor.run(LoggingInitializerConsumerActionExecutor.java:44)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
... 3 more
Any ideas?
Update
This directory exists:
C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 13.1.1\jre\jre
And I have JAVA_HOME
variable it is
C:\Java\jdk1.7.0_45
Also I have 2 gradle.properties
files in
C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10\samples\userguide\tutorial\properties\gradle.properties
and
C:\Users\<USER_NAME>\.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10\samples\signing\maven\gradle.properties
I tried to put org.gradle.java.home=C:/Java/jdk1.7.0_45
in each of them, but it did not help me.
What am I doing wrong?
Check your JDK home path in Platform Settings.
In my case it had extra '/jre' suffix, which caused the same error as you described.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With