https://kotlinlang.org logo
#compose
Title
# compose
c

CLOVIS

03/18/2023, 2:18 PM
What could be the cause of this?
Copy code
e: java.lang.Error: Something went wrong while checking for version compatibility between the Compose Compiler and the Kotlin Compiler.  It is possible that the versions are incompatible.  Please verify your kotlin version  and consult the Compose-Kotlin compatibility map located at <https://developer.android.com/jetpack/androidx/releases/compose-kotlin>
	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar$Companion.checkCompilerVersion(ComposePlugin.kt:274)
	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar.registerProjectComponents(ComposePlugin.kt:199)
Caused by: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.messages.MessageCollector.report$default(org.jetbrains.kotlin.cli.common.messages.MessageCollector, org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity, java.lang.String, org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation, int, java.lang.Object)'
	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar$Companion.checkCompilerVersion(ComposePlugin.kt:252)
Versions: • Kotlin 1.7.20 • Compose-jb 1.2.2 • Compose BOM 2023.01.00
l

Landry Norris

03/18/2023, 3:55 PM
I'd recommend not having compose-jb and jetpack compose in the same project. Jetbrains compose pulls down the android compose binaries anyways, so it just makes versioning inconsistent across platforms.
c

CLOVIS

03/18/2023, 4:06 PM
What's the compose-jb way to get material3 for Android? I seem to remember it wasn't available as part of compose-jb, but maybe that's not the case anymore?
l

Landry Norris

03/18/2023, 4:06 PM
compose.material3
It's always been there, but marked experimental until 1.4.0 comes out.
c

CLOVIS

03/18/2023, 4:10 PM
What about window-size-class?
l

Landry Norris

03/18/2023, 4:12 PM
You can add other jetpack compose dependencies for Android separately. Adding the BoM sometimes causes issues with multiplatform compose, since it changes the android artifact versions, but not other platforms.
c

CLOVIS

03/18/2023, 4:12 PM
Thanks 👍
I removed the BOM and replaced the versions by compose-jb's, but it didn't fix the problem.
l

Landry Norris

03/18/2023, 5:08 PM
Are you overriding the compose compiler version?
compose-jb 1.2.2 uses compose compiler 1.3.2, which does support 1.7.20
i

itnoles

03/18/2023, 5:31 PM
I have KMM with Jetpack Compose and JB Compose are in same projects
a

ayodele

03/18/2023, 9:09 PM
Like Jonathan, I have both jetpack and jetbrains compose in the same project.
c

CLOVIS

03/19/2023, 1:15 PM
I removed the BOM but still have the same issue… Any other ideas of what it could be?
a

ayodele

03/19/2023, 1:35 PM
Did you specify:
Copy code
composeOptions {
        kotlinCompilerExtensionVersion = "1.4.3"
    }
Version depending on your Kotlin version
c

CLOVIS

03/19/2023, 1:35 PM
Yes, in the app module, but this is happening in a library module
a

ayodele

03/19/2023, 1:41 PM
Did you add any Jetpack compose lib to
androidMain
?
c

CLOVIS

03/19/2023, 1:41 PM
JB's
compose.material3
and
compose.runtime
.
l

Landry Norris

03/19/2023, 1:49 PM
It's odd that it says there was an error checking versions. It normally prints the minimum and actual Kotlin version if they don't match.
c

CLOVIS

03/19/2023, 1:50 PM
If you look at the
Caused by:
, it fails with
NoSuchMethodError
🤔
a

ayodele

03/19/2023, 1:51 PM
@Landry Norris Jetpack throws that error unless you suppress. I dunno about JB's
@CLOVIS I'm able to sync without issues
c

CLOVIS

03/19/2023, 1:52 PM
If you want to take a look, it's the branch 110-gradle of Decouple… Running any task related to Android fails with that error (from the linter to Dokka)
It's probably some little detail somewhere, but I don't see it
a

ayodele

03/19/2023, 1:54 PM
Aiit. I'll take a look.
l

Landry Norris

03/19/2023, 1:59 PM
Not at my computer right now, but the error for compose-jb should read something like 'compose compiler 1.4.0 requires Kotlin 1.8.10, but you appear to be using 1.7.20. You can suppress this error with ... (but don't say I didn't warn you)'
c

CLOVIS

03/19/2023, 2:00 PM
I've seen it multiple times before, but this is a NoSuchMethodError so I think it's more complicated than that. Maybe a version difference with Gradle?
l

Landry Norris

03/19/2023, 2:01 PM
Or JVM difference?
c

CLOVIS

03/19/2023, 2:01 PM
🤔 Reminds me that I should specify a Java toolchain
a

ayodele

03/19/2023, 2:08 PM
compose-androidCompilerExtension = "1.4.3"
That line in your libs file is the culprit
c

CLOVIS

03/19/2023, 2:09 PM
What should it be?
a

ayodele

03/19/2023, 2:09 PM
It should be 1.3.2 as per your Kotlin version 1.7.20
I was about to reproduce the error using your compiler version
c

CLOVIS

03/19/2023, 2:11 PM
Give me a second to run it
l

Landry Norris

03/19/2023, 2:12 PM
Is 1.4.3 even out? I makes sense it failed in that case.
a

ayodele

03/19/2023, 2:12 PM
It is. But it supports Kotlin 1.8.10 higher
c

CLOVIS

03/19/2023, 2:13 PM
Yep, you're right, that was the culprit. Thanks a lot
l

Landry Norris

03/19/2023, 2:13 PM
That was quick. 1.4.0-rc feels like yesterday
488 Views