I'm getting this error: "This declaration is only ...
# intellij
b
I'm getting this error: "This declaration is only available since Kotlin 1.1 and cannot be used with the specified API version 1.0", but I am not specifying
apiVersion
, and 1.1 is supposed to be the default right? I'm using 1.1.51
k
Are you using gradle?
b
To build yes, and the build actually works fine, it's the IDE that's showing it (incorrectly) as an error
k
Did you try refreshing the gradle project? What version is the Idea plugin at?
b
1.1.51
k
Can you post your
build.gradle
?
b
hmm, can't post code in a slack thread?
k
Nope, just post it in the channel.
b
Copy code
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.1.51'
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
k
That's fine too ☺️.
b
it wasn't too long
the module build.gradle file is pretty long though...
it's pretty standard though
k
Just post that as a real file on Slack.
b
i don't think there's anything wrong with gradle though, I think the IDE is just assuming the wrong api version
k
Well did you try refreshing the gradle project?
b
yea, it didn't change anything
k
Might have to report a YouTrack issue
b
added the module build.gradle
l
@bj0 Go into IDE Settings under Other Settings -> Kotlin Compiler, and manually set it to Kotlin 1.1. This is a known bug. You should find it mentionned on StackOverflow, where's there's the link of the YouTrack issue