IntelliJ IDEA and Gradle - Cannot be applied to '(groovy.lang.Closure)'

后端 未结 8 564
感情败类
感情败类 2021-02-03 17:09

I have a Gradle file which, whenever I load open it in IntelliJ IDEA 14.1.5, shows IDE errors for the entire file. Namely all the errors seem to be either:

java.

8条回答
  •  执笔经年
    2021-02-03 17:25

    For anyone looking for a similar fix, this boiled down to the type of the module. My module was defined in my .iml file as

    type="WEB_MODULE"
    

    I created a new Gradle module and pasted in the same contents, deleted the original, renamed the new module to have the same name as the old one, and everything worked fine. When I diffed the results the only change was that the .iml file now said:

    type="JAVA_MODULE"
    

    So there's the answer, seemingly. Change your module from "web" to "java".

提交回复
热议问题