I can guess that you doesn't have repository in build.gradle, so please compare your build file with following, and then make "Gradle Refresh" in Idea.
buildscript {
ext.kotlin_version = '<version to use>'
repositories {
mavenCentral()
// or better:
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: "kotlin"
repositories {
mavenCentral()
// or better:
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
Pay more attention to buildscript part of config: repositories here is necessary!
I got config from here, with my little refinements.
You can update your Kotlin version in your project level build.gradle
file. If you have it configured the usual way, you should have the following line in it around the top:
ext.kotlin_version = '1.1.2'
To upgrade to the version matching your plugin, simply change this line to:
ext.kotlin_version = '1.1.2-3'
Edit (to respond to a question below):
The error tells you that you need to upgrade your version, the question is where to find out that you have to put in 1.1.2-3
instead of saying, for example, 1.1.2-release-Studio2.3-3
.
The best way to find out the latest version of Kotlin is by going to kotlinlang.org and looking for "Latest version". Should be right there on the front page.
Another thing to do if the version number is non-trivial like this is to check the repositories where the versions are hosted. In the case of Android, you'll probably be getting it from jcenter, for which you can find the repository page, which has all the available versions listed.
You can also browse the raw maven repository of jcenter where the files are actually hosted by going here, or look up Kotlin either on mvnrepository or on mavencentral (raw version of the latter here).
Best Answer
replace
with
Since the version with jre is absolute , just replace and sync the project
Official Documentation here Thanks for the link @ ROMANARMY