‘kaptgeneratestubsdebugkotlin’ 任务(当前目标是 17)

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

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

configuration line rendered

英文:

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

configuration line rendered

答案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>



huangapple
  • 本文由 发表于 2023年6月8日 23:52:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76433657.html
匿名

发表评论

匿名网友

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

确定