Using compose in a multiplatform project , getting...
# compose-desktop
w
Using compose in a multiplatform project , getting the error : e: This version (1.1.0-alpha01) of the Compose Compiler requires Kotlin version 1.5.21 but you appear to be using Kotlin version 1.5.31 which is not known to be compatible. Please fix your configuration (or
suppressKotlinVersionCompatibilityCheck
but don't say I didn't warn you!). FAILURE: Build failed with an exception. with this build.gradle file
Copy code
plugins {
    kotlin("multiplatform")
    id("org.jetbrains.compose") version "1.0.0-alpha3"
    id("com.android.library")
    id("kotlin-android-extensions")
//    id("com.vanniktech.maven.publish")
    id("maven-publish")
}

group = BuildConfig.Info.group
version = BuildConfig.Info.version

android {
    compileSdkVersion(BuildConfig.Android.compileSdkVersion)
    sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
    defaultConfig {
        minSdkVersion(BuildConfig.Android.minSdkVersion)
        targetSdkVersion(BuildConfig.Android.targetSdkVersion)
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

kotlin {
    android {
        publishLibraryVariants("release", "debug")
    }
    jvm("desktop") {
        compilations.all {
            kotlinOptions.jvmTarget = "11"
        }
    }
    sourceSets {
        val commonMain by getting {
            dependencies {
                api(compose.runtime)
                api(compose.foundation)
                api(compose.material)
                implementation(project(":core"))
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val androidMain by getting
        val androidTest by getting {
            dependencies {
                implementation("junit:junit:4.13.2")
            }
        }
        val desktopMain by getting {
            dependencies {
                api(compose.preview)
            }
        }
        val desktopTest by getting
    }
}
🧵 1
j
use latest alpha 4 dev build
w
So version Is 1.0.0-alpha4
?
s
The latest dev build version is 1.0.0-alpha4-build398, which also can be found here: https://github.com/jetbrains/compose-jb
1
a
You use 1.5.31 kotlin plugin (probably version is defined in different place). You should either switch to lotlin 1.5.21 or to compose 1.0.0-alpha4-build398+ (maybe some earlier versions also support 1.5.31, but 398 does for sure)
w
1.0.0-alpha4-build398 does not
a
does not what?
w
Support kotlin 1.5.31
a
it does - just run an app on 1.5.31+build398. Probably you have some issue in your build scripts. What is the error message with build398?
w
I don't have the laptop at the moment but I was getting the same error. Build 362 probably supports but I haven't checked that , someone else in the other thread said build 362 support kotlin 1.5.31
I will be testing this as soon as I get the laptop
👍 1
a
from compatibility perspective builds are incremental. So if build A supports KotlinB, than any A+ supports KotlinB or higher