当前位置:   article > 正文

Android Stdio Execution failed for task ‘:app:compileDebugKotlin‘ 报错解决_execution failed for task ':app:compiledebugkotlin

execution failed for task ':app:compiledebugkotlin'.

具体报错信息如下:

'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17)
 jvm target compatibility should be set to the same Java version.
  • 1
  • 2

很显然,这是一个版本冲突问题,compileDebugJavaWithJavac版本是1.8,compileDebugKotlin是17。我们只需将这两个版本改成同一个即可,在build.gradle中添加以下代码:

kotlinOptions {
        jvmTarget = "1.8"
    }
  • 1
  • 2
  • 3

如下图所示:
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/804609
推荐阅读
相关标签
  

闽ICP备14008679号