IntelliJ(使用gradle):即使安装了Kotlin插件也找不到 [英] IntelliJ (using gradle): Can't find Kotlin plugin even though it's installed

查看:156
本文介绍了IntelliJ(使用gradle):即使安装了Kotlin插件也找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用gradle构建我的项目,但它似乎找不到我的kotlin插件,即使我使用从磁盘安装插件添加它。





这是我收到的错误:


无法解析配置':classpath'的所有依赖关系。
无法找到org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0-release-1038。
在以下位置搜索:
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 / b / b / b / b / blockquote>

任何人都可以帮助我吗?我真的很想建立我的项目。

我可以猜测,您没有构建存储库.gradle ,因此请将您的构建文件与以下内容进行比较,然后在Idea中进行Gradle Refresh。

  buildscript {
ext.kotlin_version ='<要使用的版本>'
repositories {
mavenCentral()
//或更好:
jcenter()
}
依赖关系{
classpathorg.jetbrains.kotlin:kotlin-gradle-plugin:$ kotlin_version
}
}

apply plugin: kotlin

存储库{
mavenCentral()
//或更好:
jcenter()
}

依赖关系{
compileorg.jetbrains.kotlin:kotlin-stdlib:$ kotlin_version
}

更加注意 buildscript 部分配置:存储库这里是必需的!



来自这里,我的小改进。


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

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.

解决方案

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.

这篇关于IntelliJ(使用gradle):即使安装了Kotlin插件也找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆