IntelliJ 2018.1.4 keeps reverting to attempting to build with Gradle 4.4

Answered

Whenever I substantially change a Gradle Wrapper 4.7 build that I use in IntelliJ 2018.1.4 Ultimate (with Oracle Java SDK 10.0.1+10 on macOS 10.13.4), it keeps reverting to attempting to build with Gradle 4.4.

Gradle 4.4 doesn't work with Java 10, so IntelliJ won't build my project.  The Gradle Wrapper 4.7 builds my project without problems from the command line, so the issue is with IntelliJ.

This problem predates IntelliJ 2018.1.4, so it's not a new issue.

I think the problem is being caused by a file that IntelliJ generates named `/private/var/folders/wr/r_1nf0_s0413wqbv2n08tdkm0000gn/T/ijinit.gradle`.  It was referenced in my `idea.log`, and it contains a reference to Gradle 4.4 (see far below for the contents of this file and for relevant lines from `idea.log`).

This happened after the following changes that I made in the past:

  1. switched to using a Gradle multi-project build
  2. switched to sibling Gradle projects instead of nested Gradle projects
  3. switched to a composite build
  4. switched from top-level IntelliJ project outside Gradle projects to top-level IntelliJ project in composite gradle project
  5. switched from the Groovy DSL to the Kotlin DSL

Every time this happens, I muck about trying to fix it. Every time, IntelliJ seems to fix itself and start using the Gradle Wrapper 4.7.  I have yet to discover how IntelliJ fixes itself.

I have all of my Gradle, IntelliJ, and source files in Mercurial (except for those in the following `.hgignore`), so I can track the changes, and no identifiable changes in them correspond to whenever IntelliJ fixes itself.

`.hgignore` contents:

^\.gradle$
^\.idea/libraries/Gradle__.+\.xml$
^\.idea/uiDesigner\.xml$
^\.idea/workspace\.xml$
^build$
^out$
\.chg\..*$
\.conflict\~$
\.DS_Store$
\.orig$
\.orig\..*$
\.rej$
desktop\.ini$

So I think the issue is with some IntelliJ cache or external setting.

I've enabled the `ExternalStorageConfigurationManager` using the following in `.idea/misc.xml`:

 <component name="ExternalStorageConfigurationManager" enabled="true" />

Every once in a while, IntelliJ removes that line, but it makes no difference to it trying to use Gradle 4.4.  It still occurs with or without that line.

I've tried invalidating caches and restarting.  I've tried deleting all files & directories under the following directories:

~/Library/Caches/IntelliJIdea2018.1/compile-server/
~/Library/Caches/IntelliJIdea2018.1/compiler/
~/Library/Caches/IntelliJIdea2018.1/external_build_system/
~/Library/Caches/IntelliJIdea2018.1/frameworks/detection/
~/Library/Preferences/IntelliJIdea2018.1/tasks/

My `idea.log` contains the following (I removed date & time stamps):

INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
INFO - util.EmbeddedDistributionPaths - Looking for embedded Maven repo at '/Applications/prebuilts/tools/common/offline-m2'
INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=2018.1.4 -Didea.resolveSourceSetDependencies=true -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 --init-script /private/var/folders/wr/r_1nf0_s0413wqbv2n08tdkm0000gn/T/ijinit.gradle
INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.GradleConnectionException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.4-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:55)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:60)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:283)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$200(GradleProjectResolver.java:79)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:939)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:923)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:209)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:140)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.a(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:58)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:100)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:542)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.GradleException: Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java.
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.parseJavaVersionCommandOutput(DefaultJvmVersionDetector.java:75)
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.getJavaVersion(DefaultJvmVersionDetector.java:58)
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.getJavaVersion(DefaultJvmVersionDetector.java:44)
at org.gradle.internal.jvm.inspection.CachingJvmVersionDetector.getJavaVersion(CachingJvmVersionDetector.java:44)
at org.gradle.tooling.internal.provider.ProviderConnection.initParams(ProviderConnection.java:219)
at org.gradle.tooling.internal.provider.ProviderConnection.runClientAction(ProviderConnection.java:136)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:130)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:235)
at org.gradle.tooling.internal.consumer.connection.ParametrizedActionRunner.execute(ParametrizedActionRunner.java:36)
at org.gradle.tooling.internal.consumer.connection.CancellableActionRunner.run(CancellableActionRunner.java:51)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
... 1 more
WARN - nal.AbstractExternalSystemTask - Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java.
at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:85)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:420)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:943)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:923)
at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:209)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:140)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.a(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:58)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:100)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:542)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:614)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.api.GradleException: Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java.
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.parseJavaVersionCommandOutput(DefaultJvmVersionDetector.java:75)
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.getJavaVersion(DefaultJvmVersionDetector.java:58)
at org.gradle.internal.jvm.inspection.DefaultJvmVersionDetector.getJavaVersion(DefaultJvmVersionDetector.java:44)
at org.gradle.internal.jvm.inspection.CachingJvmVersionDetector.getJavaVersion(CachingJvmVersionDetector.java:44)
at org.gradle.tooling.internal.provider.ProviderConnection.initParams(ProviderConnection.java:219)
at org.gradle.tooling.internal.provider.ProviderConnection.runClientAction(ProviderConnection.java:136)
at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:130)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:235)
at org.gradle.tooling.internal.consumer.connection.ParametrizedActionRunner.execute(ParametrizedActionRunner.java:36)
at org.gradle.tooling.internal.consumer.connection.CancellableActionRunner.run(CancellableActionRunner.java:51)
at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
... 1 more

The contents of `/private/var/folders/wr/r_1nf0_s0413wqbv2n08tdkm0000gn/T/ijinit.gradle` are:

import org.gradle.api.internal.project.ProjectInternal
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
import org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder
import org.gradle.util.*

System.setProperty("idea.active", "true")
initscript {
dependencies {
classpath files(["/Applications/IntelliJ IDEA.app/Contents/lib/gson-2.8.2.jar","/Applications/IntelliJ IDEA.app/Contents/lib/external-system-rt.jar","/Applications/IntelliJ IDEA.app/Contents/plugins/Grails/lib/grails-gradle-tooling.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/noarg-ide-plugin.jar","/Applications/IntelliJ IDEA.app/Contents/plugins/gradle/lib/gradle-tooling-extension-api.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/allopen-ide-plugin.jar","/Applications/IntelliJ IDEA.app/Contents/plugins/gradle/lib/gradle-tooling-extension-impl.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/kotlin-plugin.jar","/Applications/IntelliJ IDEA.app/Contents/lib/groovy-all-2.4.12.jar","/Applications/IntelliJ IDEA.app/Contents/plugins/Grails/lib/grails-rt.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/sam-with-receiver-ide-plugin.jar","/Applications/IntelliJ IDEA.app/Contents/plugins/gradle/lib/gradle-api-impldep-4.4.jar","/Applications/IntelliJ IDEA.app/Contents/lib/kotlin-runtime.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/android-extensions-ide.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/kapt3-idea.jar","/Users/ross.goldberg/Library/Application Support/IntelliJIdea2018.1/Kotlin/lib/kotlin-gradle-tooling.jar"])
}
}

apply plugin: JetGradlePlugin

class JetGradlePlugin implements Plugin<Gradle> {
void apply(Gradle gradle) {
def extraModelBuilderInstance = new ExtraModelBuilder()
def isCompositeBuildsSupported = GradleVersion.current() >= GradleVersion.version("3.1")
def isOldGradle = !isCompositeBuildsSupported && GradleVersion.current() <= GradleVersion.version("2.13")
Set<ToolingModelBuilderRegistry> rootRegistries = new HashSet<>()
Set<ToolingModelBuilderRegistry> registries = new HashSet<>()
if (isOldGradle) {
gradle.allprojects { project ->
registries.add(((ProjectInternal)project).services.get(ToolingModelBuilderRegistry.class))
}
}
else {
gradle.rootProject { project ->
registries.add(((ProjectInternal)project).services.get(ToolingModelBuilderRegistry.class))
try {
if (isCompositeBuildsSupported) {
project.gradle.includedBuilds.each {
registries.add(it.configuredBuild.services.get(ToolingModelBuilderRegistry.class))
}
}
}
catch (ignore) {
}
}
}
gradle.rootProject {
registries.each {
def registry = it
while(registry.hasProperty('parent') && registry.parent != null) {
registry = registry.parent
}
rootRegistries.add(registry)
}
rootRegistries.each {
if (it.hasProperty('builders') && it.builders instanceof Collection &&
(it.builders as Collection).find { it instanceof ExtraModelBuilder} != null) {
return
}
it.register(extraModelBuilderInstance)
}
}
}
}

 

 

9 comments

Hi, Have you set gradle executable at Settings | Build, Execution Deployment|  Build Tools | Gradle, could you please provide a screenshot of Gradle settings?

0

Attached below.

Gradle magically started building properly with the Gradle Wrapper 4.7 when I added the same `gradle.properties` to my composite build and to each of my three included builds.  it only set one property:

    org.gradle.warning.mode=all

A completely unrelated build.gradle & settings.gradle were in an ancestor directory before I added the `gradle.properties`, and I moved them elsewhere when I realized that a different Gradle project that had no `settings\.gradle(\.kts)?`was picking up the one in the ancestor directory (I have no clue why gradle does this, but see the `-u` command-line option).  All of my builds from this question, however, have both a `build.gradle.kts` & a `settings.gradle.kts`, and the ancestor copies were completely outside my IntelliJ project, so the ancestor files shouldn't have influenced things, but, who knows…?

I guess that the addition of the gradle.properties somehow forced IntelliJ to refresh something that it had cached, which then got it to properly use the 4.7 Wrapper instead of the built-in 4.4 distribution, but I don't know if that's correct…

0

Has the default version of Gradle used by IntelliJ been updated to 4.7?

0

Hi, I am also having this problem. Adding my gradle.properties file to subprojects did not help in my case. I also have IntelliJ's Gradle integration set to use the default wrapper.

0

The name of the generated `.gradle` file (`ijinit`) only occurs once in the intellij-community repo (https://github.com/JetBrains/intellij-community/search?q=ijinit&unscoped_q=ijinit).

 

The contents of that generated file appear to be supplied by https://github.com/JetBrains/intellij-community/blob/6a31a529006b408a6c9bee4f629212a2821a45a3/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/init.gradle.

The line in the file that references gradle 4.4 seems to be generated from the use of `EXTENSIONS_JARS_PATH` on https://github.com/JetBrains/intellij-community/blob/6a31a529006b408a6c9bee4f629212a2821a45a3/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/init/init.gradle#L9

In the repo, however, I only see two reads of `EXTENSIONS_JARS_PATH`, and no definition for it.  So I have no clue how that is populated.

I don't know if that presumed constant gets a different value when Gradle Wrapper 4.7 is properly used by IntelliJ, or if that file is never geenrated, or generated differently, etc., when IntelliJ feels like playing nice with Gradle 4.7.

0

It looks like gradle has been updated to 4.7 in the `master` branch https://github.com/JetBrains/intellij-community/blob/81230c2c663ead70c65f0c9524dd5784b905e10e/.idea/libraries/Gradle.xml

It seems like there'd still be a problem if IntelliJ uses its Gradle binaries instead of the Gradle Wrapper binaries, even if the binaries will happen to be the same version once the change to 4.7 is released.  I might configure my Gradle Wrapper differently than IntelliJ's Gradle binaries, and I might upgrade to 4.8, 4.9, 5.0, etc., before IntelliJ updates its Gradle binaries, so it makes sense to get to the bottom of this.

0

Thanks.  I added a link to this discussion in the newer YouTrack issue.

0

It is possible to fix this problem by configuring Gradle Wrapper from the command-line to specific version: 4.7.

I have written down the specific instructions here: https://iwillteachyoukotlin.com/2018/06/05/fix-gradle-4-4-4-7-jdk-10-intellij-idea-2018-1/

0

Please sign in to leave a comment.