Android studio kotlin 插件报错

标签 android android-studio gradle kotlin

在 android studio 中出现错误:

Plugin Error: Kotlin threw an uncaught AbstractMethodError. Disable Plugin

昨天一切正常。 Gradle :

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 工作室版本: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 之后

最佳答案

Plugin Error: Kotlin threw an uncaught AbstractMethodError.

你应该升级kotlin_version .使用 1.1.60 而不是 1.1.51

   ext.kotlin_version = '1.1.60'

注意

1.1.60BUGGY。降级您的版本。

然后Clean-Rebuild-Gradle

关于Android studio kotlin 插件报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47469662/

相关文章:

java - 在mavenLocal()中为.jar文件成功添加gradle依赖关系之后,我如何实际从Java类导入和使用该jar

java - 使用 SBT 将 Artifact 发布到本地 Maven 仓库并在 ​​Gradle 项目中使用它

android - 如何在 Android 中创建 DragEvent

android - 在配置更改时更改 DialogFragment 中的布局和保存状态

android - 不使用 Observable.create 创建 Observable

android - 发现多个文件的操作系统独立路径为 'kotlin/reflect/reflect.kotlin_builtins' - Unity 项目

android - 仅启用混淆器以删除未使用的代码

java - 定义一个 gradle 任务来运行 caliper microbenchmark

java - 如何使用扩展Activity实现onClicklistener的多个列表项点击

android-studio - 无法将新的 APK 文件上传到 Android Play 商店(Android 支付许可)