Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ (using gradle): Can't find Kotlin plugin even though it's installed

I'm trying to build my project using gradle but it seems that it can't find my kotlin plugin, even though I did add it using "install plugin from disk".

enter image description here

This is the error I'm getting:

Could not resolve all dependencies for configuration ':classpath'. Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-release-1038. Searched in the following locations: https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.0.0-release-1038/kotlin-gradle-plugin-1.0.0-release-1038.pom https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.0.0-release-1038/kotlin-gradle-plugin-1.0.0-release-1038.jar

Can anyone help me with this? I'd really like to build my project.

like image 675
SJ19 Avatar asked Feb 26 '16 12:02

SJ19


1 Answers

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.

like image 133
Ruslan Avatar answered Sep 28 '22 09:09

Ruslan