IntelliJ 13.1 EAP can't import a Gradle project using 1.12-rc-1


(Justin Ryan) #1

Importing using 13.1 EAP against 1.12-rc-1 results in a MethodNotFoundException. It looks to be related to an internal class changing and IntelliJ not knowing about it. I filed a ticket with JetBrains: http://youtrack.jetbrains.com/issue/IDEA-124171. Is anyone else seeing this issue?

Were the major IDEs tested before releasing the RC?


(John Engelman) #2

Looks like that class changed with this commit: https://github.com/gradle/gradle/commit/6c8e02b4fa823b5a4b8eb8a57bdffa34640ae510

To be fair, that’s an internal API and IDEA shouldn’t really be using it.


(Radim Kubacki) #3

We do care about interoperability with IDEs. In fact 1.12 aims to improve the situation and help to avoid some of the usages of internal code in Gradle and make the integration more stable. I can’t say when IDEA will release their updates with a fix to this problem but I think they will have it ready soon after 1.12 release and @jengels mentioned there is a workaround for this problem.


(blackbeltdev) #4

IntelliJ 13.1.3 was just released. It still is having problems with existing project using either Gradle 1.12 or 1.11. Note that IJ 13.1.2 did work with Gradle 1.11. Now it works with neither.

The problem seems to be with custom resolutionStrategy, i.e.

configurations.all {
          resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            if (details.requested.name == 'commons-logging') {
                //prefer 'log4j-over-slf4j' over 'log4j', with fixed version:
                details.useTarget "org.slf4j:jcl-over-slf4j:$slf4jVersion"
            }
        }
    }

Works fine from command-line. IJ blows up though:

  Error:Cause: groovy.lang.MissingMethodException: No signature of method: org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.eachDependency() is applicable for argument types: (build_5m6ps13eq4rlm2m9jtss3lpfoo$_run_closure2_closure8_closure21) values: [build_5m6ps13eq4rlm2m9jtss3lpfoo$_run_closure2_closure8_closure21@39d5c274]  Possible solutions: eachDependency(org.gradle.api.Action)  No signature of method: org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.eachDependency() is applicable for argument types: (build_5m6ps13eq4rlm2m9jtss3lpfoo$_run_closure2_closure8_closure21) values: [build_5m6ps13eq4rlm2m9jtss3lpfoo$_run_closure2_closure8_closure21@39d5c274]  Possible solutions: eachDependency(org.gradle.api.Action)  

(blackbeltdev) #5

I logged this with IJ support:

https://intellij-support.jetbrains.com/requests/30172

I am Ultimate customer so hopefully will be fixed soon.


(Radim Kubacki) #6

To Kirk: your problem seems different than the general interoperability between IJ13 and Gradle 1.12+. Perhaps it would be better to move it into a new thread. Anyway, I can’t follow your ticket filled against IJ since I do not have access to that system.


(blackbeltdev) #7

Thanks Radim. Don’t you have a back channel with IntelliJ? :slight_smile:

I think the link will go public once they accept it as defect. I’ll post a new thread once it goes public.


(blackbeltdev) #8

Apparently they are on it already:

http://youtrack.jetbrains.com/issue/IDEA-125592


(John Engelman) #9

Just some additional information - this bug in IDEA doesn’t seem to be related just to >= 1.12-rc-1. With IDEA 13.1.3, I’m seeing this same error on projects with Gradle 1.9. I also saw the problem start with the EAP release (build 135.908) just before 13.1.3 GA (build 135.909).

Not sure about versions before that, I wasn’t running the EAP before 135.908.