无法配置Gradle项目(科特琳代码)

时间:2018-06-19 12:46:27

标签: gradle kotlin

我在Gradle中非常新鲜。我正在尝试使用Gradle构建项目Kotlin代码。 我花了一些时间按照以下说明来学习:https://kotlinlang.org/docs/reference/using-gradle.html

到目前为止,我还没有成功,但是遇到了一些错误。

我的build.gradle显示如下:

group = "kotlin"
version = "1.0-SNAPSHOT"

buildscript {
    ext.kotlin_version = '1.2.50'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: "kotlin"

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

我收到以下错误

org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
....
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.50.

enter image description here

0 个答案:

没有答案