当前位置: 首页>移动开发>正文

Android Stdio 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.

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

kotlinOptions {
        jvmTarget = "1.8"
    }

如下图所示:
Android Stdio Execution failed for task ‘:app:compileDebugKotlin‘ 报错解决,在这里插入图片描述,第1张


https://www.xamrdz.com/mobile/45j1849095.html

相关文章: