【问题标题】:Android studio kotlin plugin errorAndroid studio kotlin 插件错误
【发布时间】:2017-11-24 09:00:39
【问题描述】:

在 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

【问题讨论】:

  • 添加整个 build.gradle
  • 插件是什么版本?
  • @Toolazy 你得到了解决方案
  • 是的,发布了答案

标签: android android-studio gradle kotlin


【解决方案1】:

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

您应该升级kotlin_version。使用 1.1.60 而不是 1.1.51

   ext.kotlin_version = '1.1.60'

注意

1.1.60BUGGY。降级您的版本。

然后Clean-Rebuild-Gradle

【讨论】:

【解决方案2】:

正如@IntelliJ Amiya 所说,将 kotlin 插件降级回 1.1.51 可以解决问题。 1.1.60 越野车(

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-28
    • 1970-01-01
    • 2018-07-20
    • 1970-01-01
    相关资源
    最近更新 更多