英文:
'kaptgeneratestubsdebugkotlin' task (current target is 17)
问题
Sure, here's the translated content:
"'compiledebugjavawithjavac' task (current target is 1.8) and 'kaptgeneratestubsdebugkotlin' task (current target is 17) jvm target compatibility should be set to the same java version.
"
"I solve this problem like this"
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach {
kotlinOptions { jvmTarget = "1.8" }
}
英文:
'compiledebugjavawithjavac' task (current target is 1.8) and 'kaptgeneratestubsdebugkotlin' task (current target is 17) jvm target compatibility should be set to the same java version.
I solve this problem like this
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach{
kotlinOptions{jvmTarget = "1.8"}
}
答案1
得分: 2
如果您遇到类似的问题,您必须在 build.grade(app) 中添加以下代码:
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
英文:
If you encounter a similar problem you must add this code in build.grade(app)
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach{kotlinOptions{jvmTarget = "1.8"}}
答案2
得分: 0
allprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
}
}
英文:
allprojects{
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs).configureEach{
kotlinOptions{
jvmTarget= JavaVersion.VERSION_1_8
}
}
}
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论