【问题标题】:Execution failed for task ':common:kaptDebugKotlin'任务 ':common:kaptDebugKotlin' 执行失败
【发布时间】:2021-05-11 06:36:17
【问题描述】:

将 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'
    }
}

欢迎提出任何建议。

【问题讨论】:

    标签: android gradle android-gradle-plugin


    【解决方案1】:

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

    我尝试升级 gradle 版本

    project#gradle-wrapper.properties -> 如下更改 distributionUrl

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

    同步项目。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-07
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 2018-08-20
    • 2016-05-02
    • 2022-01-19
    • 2021-11-14
    相关资源
    最近更新 更多