"Cannot resolve symbol" in Intellij IDEA 12.1.6+ Gradle 1.9


(Adil Akhter) #1

Hi, I am new to Gradle and am trying to set it up in my development environment (windows + Intellij IDEA 12.1.6). So, according to the ‘getting stated guide’ in gradle.org, I have installed Gradle 1.9.

PS C:\work> gradle -v
------------------------------------------------------------
Gradle 1.9
------------------------------------------------------------
  Build time:
 2013-11-19 08:20:02 UTC
Build number: none
Revision:
   7970ec3503b4f5767ee1c1c69f8b4186c4763e3d
  Groovy:
     1.8.6
Ant:
        Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:
        2.2.0
JVM:
        1.6.0_26 (Sun Microsystems Inc. 20.1-b02)
OS:
         Windows 7 6.1 amd64

In addition, I have installed Intellij Gradle plugin.

Now, the problem is that when I open a *.gradle file in Intellij IDEA, it complains that “can not resolve symbol X” where X is any keyword of Gradle DSL (see screenshot below).

I highly appreciate if anyone can tell me how to fix this issue or point me to documentation which address this issue.


(Peter Niederwieser) #2

I recommend to switch to IntelliJ 13 (EAP), which comes with a completely new and much improved Gradle plugin. Alternatively, you could raise an issue with IntelliJ 12, but with the release of IntelliJ 13 around the corner, I don’t think the IntelliJ 12 Gradle plugin will see much further work.


(Adil Akhter) #3

Hi Peter,

Thanks for the pointer. I have tried with Intellij 13(EAP) as well. Unfortunately, same issue can be reproducible there as well.

I was wondering whether it is a known issue that it does not work, or it is just my IDEA where it breaks.

Regards, Adil


(Peter Niederwieser) #4

If I remember correctly, late versions of 12.1 did have initial support for understanding Gradle build scripts. In recent 13 EAPs this got a lot better, and it definitely understands blocks like ‘repositories’ for me. I might help if you explained in detail how you imported the project into IntelliJ, whether you are using the Gradle wrapper, etc. Also, please try with the very latest EAP (I think they are at rc-1 now).