任务 ':common:kaptDebugKotlin' 执行失败

时间:2021-05-11 06:36:17

标签: android gradle android-gradle-plugin

将 android studio 更新到 4.2 后,我的项目遇到以下错误。

    Execution failed for task ':common:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)

我的 build.gradle 文件如

buildscript {
    ext.kotlin_version = '1.3.72'

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

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.4'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
    }
}

感谢任何建议。

1 个答案:

答案 0 :(得分:1)

我升级到 4.2 版本后遇到了这个问题。

我尝试升级gradle版本

project#gradle-wrapper.properties -> 像下面一样改变 distributionUrl

distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

同步项目。