Why am I getting Backend Internal error: "Exception during IR lowering error" when using Jetpack Compose clickable-Modifier?

Solution 1:

So I got in touch with the JetBrains team via their issue tracker as @PhilipDukhov suggested and they solved my problem: https://youtrack.jetbrains.com/issue/KT-48815.

I was using kotlinCompilerExtensionVersion = versions.composeVersion in my app's build.gradle file and this is incorrect. versions.composeVersion is something provided by Gradle but it seems to be deprecated. Oneself should manually write the version which they're using there.

Solution 2:

In my case, I forgot to add in the build.gradle

android {
 ... 

    buildFeatures {
       compose true
    }
    composeOptions {
       kotlinCompilerExtensionVersion '1.0.3'
       kotlinCompilerVersion '1.5.30'
    }
}

Solution 3:

In my case I've created independent module to maintain components and theme independent of functional modules. So updating below in that modules gradle inside android, worked for me.

   android {
.
.
.
         buildFeatures {
                compose true
            }
            composeOptions {
                 kotlinCompilerExtensionVersion '1.0.3'
                 kotlinCompilerVersion '1.5.30'
            }
    }

Solution 4:

its because of JetpackCompose! in gradle 7.2 you should add these lines in build.gradle in android block:

  kotlinOptions {
        jvmTarget = "1.8"
    }
    
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.0.4"
    }