What could be the cause of this? ```e: java.lang.E...
# compose
c
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
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
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
compose.material3
It's always been there, but marked experimental until 1.4.0 comes out.
c
What about window-size-class?
l
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
Thanks 👍
I removed the BOM and replaced the versions by compose-jb's, but it didn't fix the problem.
l
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
I have KMM with Jetpack Compose and JB Compose are in same projects
a
Like Jonathan, I have both jetpack and jetbrains compose in the same project.
c
I removed the BOM but still have the same issue… Any other ideas of what it could be?
a
Did you specify:
Copy code
composeOptions {
        kotlinCompilerExtensionVersion = "1.4.3"
    }
Version depending on your Kotlin version
c
Yes, in the app module, but this is happening in a library module
a
Did you add any Jetpack compose lib to
androidMain
?
c
JB's
compose.material3
and
compose.runtime
.
l
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
If you look at the
Caused by:
, it fails with
NoSuchMethodError
🤔
a
@Landry Norris Jetpack throws that error unless you suppress. I dunno about JB's
@CLOVIS I'm able to sync without issues
c
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
Aiit. I'll take a look.
l
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
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
Or JVM difference?
c
🤔 Reminds me that I should specify a Java toolchain
a
compose-androidCompilerExtension = "1.4.3"
That line in your libs file is the culprit
c
What should it be?
a
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
Give me a second to run it
l
Is 1.4.3 even out? I makes sense it failed in that case.
a
It is. But it supports Kotlin 1.8.10 higher
c
Yep, you're right, that was the culprit. Thanks a lot
l
That was quick. 1.4.0-rc feels like yesterday
513 Views