0

I can't figure out why I keep getting Error:(28, 0) Build script error, unsupported Gradle DSL method found: 'compileOnly()'! when refreshing my Gradle project on Intellij. This is the relevant section of my build.gradle:

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compileOnly 'org.projectlombok:lombok:1.16.18'
    compile group: 'com.google.guava', name: 'guava', version: '22.0'
}

I'm using gradle 3.5.1:

$ gradle -v

------------------------------------------------------------
Gradle 3.5.1
------------------------------------------------------------

Build time:   2017-06-16 14:36:27 UTC
Revision:     d4c3bb4eac74bd0a3c70a0d213709e484193e251

Groovy:       2.4.10
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_66 (Oracle Corporation 25.66-b18)
OS:           Windows 10 10.0 amd64

And I get the same if I print GRADLE_HOME as suggested here:

$ gradle getHomeDir

:getHomeDir
C:\Program_Files\gradle-3.5.1

BUILD SUCCESSFUL

gradle build runs fine from command line. I've tried adding apply plugin: 'idea' as suggested by the IDEA, and also running gradle idea from command line, but I'm still stuck with this problem.

These are my Gradle settings:

Gradle settings

saralor
  • 61
  • 1
  • 7

0 Answers0