英文:
Android Studio Flamingo - kaptGoogleDebugKotlin error
问题
我已下载了最新的Android Studio Flamingo(2022.2.1 补丁 2),但在构建我的项目时,出现了以下问题:
执行任务':app:kaptGoogleDebugKotlin'失败。
在执行org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction时发生故障
java.lang.reflect.InvocationTargetException(没有错误消息)
在之前版本的Flamingo中,我没有遇到这个问题。出了什么问题?
英文:
I have downloaded latest Android Studio Flamingo (2022.2.1 patch 2) but during the build of my project, I got the following:
Execution failed for task ':app:kaptGoogleDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
In the previous version of Flamingo, I did not have this problem. What is wrong?
答案1
得分: 1
After move to Android Studio: Flamingo, remember these imp few thing
- Install/Update JDK 17 in your system and set as JAVA_HOME
example-> C:\jdk17\openjdk-17.0.6
- set target JDK version 17
example:
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
- If you use DI framework Hilt or Dagger2 dependency then update with latest version
Example:
// Dagger DI
implementation 'com.google.dagger:dagger:2.47'
kapt 'com.google.dagger:dagger-compiler:2.47'
-
If any other dependency or lib give such error while building just update with latest version
-
Please note Kotlin version should be 1.8.## and Gradle should be 8.0
Above 5 points will help you to resolve Flamingo and above version of Android studio issue.
英文:
After move to Android Studio: Flamingo, remember these imp few thing
- Install/Update JDK 17 in your system and set as JAVA_HOME
example-> C:\jdk17\openjdk-17.0.6
- set target JDK version 17
example:
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
- If you use DI framework Hilt or Dagger2 dependency then update with latest version
Example:
// Dagger DI
implementation 'com.google.dagger:dagger:2.47'
kapt 'com.google.dagger:dagger-compiler:2.47'
-
If any other dependency or lib give such error while building just update with latest version
-
Please note Kotlin version should be 1.8.## and Gradle should be 8.0
Above 5 points will help you to resolve Flamingo and above version of Android studio issue.
答案2
得分: 0
我已将JDK版本更改为最新的Amazon Corretto JDK,问题已解决。
英文:
I have changed JDK version to the latest Amazon Corretto JDK and the problem went away.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论