본문 바로가기

개발일기

23.09.12 부트캠프 63일차 TIL toolchain error

kotlinOptions {
    jvmTarget = '1.8'
}

kotlin {
    jvmToolchain(17)
}

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17.toString()
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    
    
    
    
    
    
    또는 -------------------------------------------------
    
      kotlinOptions {
        jvmTarget = '1.8'
    }    
     kotlin {
        jvmToolchain(17)
    }
     compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
  
   

        kotlinOptions {
            jvmTarget = JavaVersion.VERSION_17.toString()
        }
    


        buildFeatures{
        viewBinding = true
    }

 

build.gradle에 추가 

 

 

 

 

Execution failed for task ':app:kapGenerateStubsDebugKotlin

>'compileDeugJavaWithJavac' task (current target is 1.8) and 'kapGenerateStubsDebugKotlin' task (current target is 17) jvm target compatiability should be set to the same Java version.

 

Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain 

 

Configure a Gradle project | Kotlin

 

kotlinlang.org