[Jetpack Compose] Kotlin Gradle Plugin 2.1.0
Versions
Code Connect CLI version: 1.2.4
Code Connect lib: 1.1.3
Kotlin Gradle Plugin: 2.1.0
Issue
figma connect publish --token ... --verbose
Config file found, parsing /Users/... using specified include globs
Running parser: ./gradlew -p . parseCodeConnect -PfilePath=tmp/figma-code-connect-parser-io.json.tmp -q
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':code-connect:parseCodeConnect'.
> Could not initialize class org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
* Try:
> Run with --stacktrace
option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan
to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 4s
Error returned from parser: Parser exited with code 1. Try re-running the command with --verbose for more information.
Workaround
Downgrade the Kotlin Gradle Plugin from 2.1.0 to 2.0.21
Hey @corentin-stamper, thanks for the report! We can repro this on our end, as you said there's some incompatibility between Code Connect and Kotlin Gradle Plugin 2.1.0 - we haven't identified exactly what it is yet but still investigating.
Hey @slees-figma, do you any updates on this topic?
👋 Any updates on this @slees-figma? We hope to use Code Connect, but this is a blocker.
Hey all, I'm afraid we don't have any updates to share on this right now - we've been investigating upgrading this but having problems getting it working alongside our other deps. Will keep you posted on here as we investigate further.
@slees-figma Is there any update on this? We'd like to use Code Connect (especially with the new MCP announcement), but this is a blocking issue for us.
@slees-figma @tomduncalf-figma We're likewise eager to get Code Connect working again for Compose UI (and excited to try the announced MCP features). Is there any update on this? Thanks!
Hey everyone sorry for the delay on this - we've now identified this as a bug in the 2.1.X Kotlin compiler which we've confirmed is fixed as of Kotlin version 2.2.0-RC.
If you're able to upgrade to the new release candidate 2.2.0-RC, could you try to publish again and report back?
Incredible! We're able to publish again, but with the Code Connect plugin added, we now get:
Unable to find method ''org.jetbrains.kotlin.buildtools.api.jvm.ClasspathEntrySnapshot org.jetbrains.kotlin.buildtools.api.CompilationService.calculateClasspathSnapshot(java.io.File, org.jetbrains.kotlin.buildtools.api.jvm.ClassSnapshotGranularity, boolean)''
'org.jetbrains.kotlin.buildtools.api.jvm.ClasspathEntrySnapshot org.jetbrains.kotlin.buildtools.api.CompilationService.calculateClasspathSnapshot(java.io.File, org.jetbrains.kotlin.buildtools.api.jvm.ClassSnapshotGranularity, boolean)'
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Commenting out the Code Connect plugin when building resolves this.
Does Code Connect require an update to Kotlin Version 2.2.0 as well, when stable?
Hey @sausti, we haven't seen this error on our end - did you try the steps suggested in the error?
Does Code Connect require an update to Kotlin Version 2.2.0 as well, when stable?
Absolutely, we'll make this change once 2.2.0's stable
Hey @sausti, we haven't seen this error on our end - did you try the steps suggested in the error?
Does Code Connect require an update to Kotlin Version 2.2.0 as well, when stable?
Absolutely, we'll make this change once 2.2.0's stable
We've tried the steps outlined in the error and have performed a build clean, invalidated the cache, etc. We believe the Code Connect Kotlin version update should resolve this issue, so we'll try again then!
@slees-figma, now that Kotlin 2.2.0 is stable, could this dependency be updated in Code Connect?
@slees-figma, now that Kotlin 2.2.0 is stable, could this dependency be updated in Code Connect?
Or @rgullyfigma, as I believe this is partly related to #287. Thanks!
Hey @sausti! Yes, I think we should do this. I'll bring this to the team, and will aim to add this to the next Code Connect release.
@rgullyfigma Any updates on when there will be a new Code Connect release? Thanks!
@rgullyfigma @slees-figma We would be grateful if you could respond at your earliest convenience. Our team is very excited about using Code Connect, and we’re eager to move ahead.
Hey all, we've now released a new version of our Gradle plugin which updates the Kotlin version to 2.2.21.