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

前端 未结 1 1465
礼貌的吻别
礼貌的吻别 2021-01-06 01:40

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\".

相关标签:
1条回答
  • 2021-01-06 02:16

    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.

    0 讨论(0)
提交回复
热议问题