본문 바로가기

Android/에러 모음

jvm 버전 에러

728x90
반응형

Execution failed for task ':GabiaDaaSClient:compileDebugKotlin'.
> Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':GabiaDaaSClient:compileDebugKotlin'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
와 같은 에러

 

Java와 Kotlin의 JVM 타겟 버전이 일치하지 않아서 발생

compileDebugJavaWithJavac 작업은 JVM 타겟 버전 1.8을 사용하고 있지만, compileDebugKotlin 작업은 JVM 타겟 버전 17을 사용하려고 하여 호환성 문제가 발생한 것

 

build.gradle(Module) 부분의 android 부분에 추가

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}

 

 

 

728x90
반응형