-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to link downstream project consuming Kotlin/Native-built runtime #2342
Comments
I will research |
I reproduced this problem with iosSimulatorArm64Test task. I will continue try to fix it. But also, for now, you may use only jvm tests: |
I can reproduce this, also happens when building to an iOS app target not just testing only. I can't use compose runtime in shared module because of this. |
Thanks! I will research your sample |
Just noticed the same error in another project. In my case the compose compiler was not applied for k/native targets. UPD: beside applying the compiler plugin, ComposeGradlePlugin also adds compiler options for k/js - https://github.com/JetBrains/compose-jb/blob/3996233b032772a5afb8ceceafc4affae793e480/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposeCompilerKotlinSupportPlugin.kt#L67 So I guess, k/js is probably not working too in molecule:runtime? cc: @JakeWharton |
You are correct we are not specifying the JS option correctly. Molecule's multiplatform entrance is a little more rash than Redwood where we did things a bit more carefully. That being said, we cannot use your Compose plugin because it assumes things about the JS target (the presence of a web extension) that doesn't work in the general case. In Redwood we have a proper subproject plugin which applies the Compose compiler plugin and configures the JS build correctly: https://github.com/cashapp/redwood/blob/3956a7883950951f38e5d0c442d63b32cdfc955f/build-support/src/main/kotlin/app/cash/redwood/buildsupport/ComposePlugin.kt. I will do the same in Molecule here shortly. |
This issue has resolved itself, but I'm not quite sure why. I upgraded to Kotlin 1.7.20 and JB Compose 1.2.1 (and compiler 1.3.2.1) along with adding the (Separately I fixed our Gradle plugin to use JS decoys for downstream projects as well as using JS decoys for our own build. Thanks!) Going to preemptively close and hope it's not an issue in the future! |
I was also able to fix this specific issue by upgrading to Kotlin 1.7.20, but ended up running into another wall:
@JakeWharton Do you still have your |
@saket Did you add |
Yea I already had |
I have a work-in-progress pr to include molecule into my playground app: https://github.com/hfhbd/ComposeTodo/pull/665/files I had to add the molecule runtime manually though because I also use the compose plugin: cashapp/molecule#134 |
@saket Can you please try version 1.3.0-alpha01-dev849 |
Sure, where are your alpha builds hosted on? I couldn't find any information in your readme or releases page. |
@hfhbd going through this, thank you! |
Thanks! I'm seeing the same error with |
@saket I had the same error in my case when using molecule. Its was caused due that composable functions couldn't be public in native (at least this is what I've read). I fixed it changing them to internal (an in my case only expose the flow created by the molecule launch) |
@saket |
Did this change or is this still valid? |
This part is fixed when using kotlin 1.8.20 and compose 1.4.0 kotlin.native.cacheKind=none - this parameter is still needed. The investigation has started by k/native team |
Unfortunately i still get error: Edit: |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
I have
kotlin.native.cacheKind=none
set in the project'sgradle.properties
but it still does not compile.Repro on this branch https://github.com/cashapp/molecule/tree/jw/link-thing/2022-09-21 running
./gradlew -p molecule :m-r:check
.The text was updated successfully, but these errors were encountered: