Cannot Use Kotlin 2.0 Features After Upgrade

PressRex profile image
by PressRex
Cannot Use Kotlin 2.0 Features After Upgrade

I upgraded my Android project to Kotlin 2.0, but I still can't use Kotlin 2.0 features. I believe I have done the integration correctly, yet I keep encountering this issue:

libs.toml

[plugins]
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version = "2.0.0"}

app.gradle

plugins {
  alias(libs.plugins.kotlin.compose.compiler) apply false
}

build.gradle

plugins {
    alias(libs.plugins.kotlin.compose.compiler)
}

gradle.properties

kapt.use.k2=true
ksp.useK2=true

I also removed composeOptions from the build.gradle file. However, IDE still warns me. Pls check this photo below.

I'm attaching the code here for you to copy

interface Status {
        fun signal() {}
    }
    
    interface Ok : Status
    interface Postponed : Status
    interface Declined : Status
    
    fun signalCheck(signalStatus: Any) {
        if (signalStatus is Postponed || signalStatus is Declined) {
            signalStatus.signal()
        }
    }

Source: View source

PressRex profile image
by PressRex

Subscribe to New Posts

Lorem ultrices malesuada sapien amet pulvinar quis. Feugiat etiam ullamcorper pharetra vitae nibh enim vel.

Success! Now Check Your Email

To complete Subscribe, click the confirmation link in your inbox. If it doesn’t arrive within 3 minutes, check your spam folder.

Ok, Thanks

Read More