After updating Android Studio Flamingo 2022.2.1 Patch 1, i got error Execution failed for task ':app:kaptDebugKotlin'

huangapple go评论61阅读模式
英文:

After updating Android Studio Flamingo 2022.2.1 Patch 1, i got error Execution failed for task ':app:kaptDebugKotlin'

问题

I got error of "Execution failed for task ':app:kaptDebugKotlin'".

`Execution failed for task ':app:kaptDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
java.lang.reflect.InvocationTargetException (no error message)`

My mac is intel so M1 is not the problem.
I tried so many suggestions on stack overflow. but i still can't find the answer,,,,

My gradle JDK is 17.0.6

== remove code that i have uploaded a part of gradle files ==

英文:

I got error of "Execution failed for task ':app:kaptDebugKotlin'"

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

My mac is intel so M1 is not the problem.
I tried so many suggestions on stack overflow. but i still can't find the answer,,,,

My gradle JDK is 17.0.6

== remove code that i have uploaded a part of gradle files ==

答案1

得分: 1

我的问题是Android Studio的JDK版本和我的Java版本不同•••

在升级Android Studio后,其JDK版本设置为JDK 17。但是,我的Java版本仍然是14.0.1。因此,我将它们都设置为相同的版本。

这就是为什么我陷入了构建错误中,太愚蠢了!

无论如何,希望有人能轻松解决这种问题!

在终端中检查:java -version

在Android Studio中检查JDK版本:设置 > 构建 > Gradle > 'Gradle JDK'

英文:

My problem was Android Studio JDK version and my Java version was different•••

after upgrading Android Studio, its JDK version sets to JDK 17. but, my Java version is still 14.0.1. So, I set both in the same version.

That's why i stuck in build error,,! so,, stupid,,,

anyway i hope someone to solve this kind of problem easily!

check in terminal : java -version

check the JDK version in Android Studio : settings > Build > Gradle > 'Gradle JDK'

huangapple
  • 本文由 发表于 2023年5月10日 19:36:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76217926.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定