code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

[Jetpack Compose] Kotlin Gradle Plugin 2.1.0

Open corentin-stamper opened this issue 1 year ago • 4 comments

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

corentin-stamper avatar Dec 17 '24 10:12 corentin-stamper

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.

slees-figma avatar Dec 20 '24 10:12 slees-figma

Hey @slees-figma, do you any updates on this topic?

corentin-stamper avatar Feb 10 '25 09:02 corentin-stamper

👋 Any updates on this @slees-figma? We hope to use Code Connect, but this is a blocker.

sausti avatar Mar 03 '25 22:03 sausti

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 avatar Mar 04 '25 18:03 slees-figma

@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.

colinrtwhite avatar Jun 04 '25 21:06 colinrtwhite

@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!

sausti avatar Jun 13 '25 12:06 sausti

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?

slees-figma avatar Jun 13 '25 14:06 slees-figma

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?

sausti avatar Jun 13 '25 18:06 sausti

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

slees-figma avatar Jun 16 '25 09:06 slees-figma

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!

sausti avatar Jun 16 '25 10:06 sausti

@slees-figma, now that Kotlin 2.2.0 is stable, could this dependency be updated in Code Connect?

sausti avatar Jun 25 '25 21:06 sausti

@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!

sausti avatar Jul 22 '25 22:07 sausti

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 avatar Jul 25 '25 09:07 rgullyfigma

@rgullyfigma Any updates on when there will be a new Code Connect release? Thanks!

sausti avatar Sep 02 '25 22:09 sausti

@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.

Latest kotlin version 2.2.21

jack-takashi avatar Oct 29 '25 06:10 jack-takashi

Hey all, we've now released a new version of our Gradle plugin which updates the Kotlin version to 2.2.21.

slees-figma avatar Nov 06 '25 10:11 slees-figma