Android studio kotlin插件错误

时间:2017-11-24 09:00:40

标签: android android-studio gradle kotlin

在android studio中我遇到错误:

Plugin Error: Kotlin threw an uncaught AbstractMethodError. Disable Plugin

昨天一切都很好。 摇篮:

buildscript {
    ext.kotlin_version = '1.1.51'
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Android studio版本:3.0.1 Build#AI-171.4443003

更多:如果我使用kotlin支持创建新的android项目失败并出现相同的错误。

#EDIT1

完全根gradle构建脚本。

buildscript {
    ext.kotlin_version = '1.1.60'
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1.1.60无济于事。还是一样的错误。而且仍在

Your version of Kotlin runtime in 'org.jetbrains.kotlin:kotlin-stdlib:1.1.51@jar' library is 1.1.51, while plugin version is 1.1.60-release-Studio3.0-1. 

即使更新到1.1.60

之后

1 个答案:

答案 0 :(得分:1)

  

插件错误:Kotlin抛出了一个未被捕获的AbstractMethodError。

您应升级kotlin_version。使用 1.1.60 代替 1.1.51

   ext.kotlin_version = '1.1.60'

注意

1.1.60 BUGGY 。降级你的版本。

然后 Clean-Rebuild-Gradle