https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
d

darkmoon_uk

08/05/2022, 1:25 AM
Anyone familiar with this issue? Performing
linkDebugFrameworkIosArm64
against a library module with Compose/iOS:
Copy code
e: Module "org.jetbrains.compose.runtime:runtime-saveable (org.jetbrains.compose.runtime:runtime-saveable-uikitarm64)" has a reference to symbol androidx.compose.runtime/remember|-2215966373931868872[0]. Neither the module itself nor its dependencies contain such declaration.
...I've cleaned, removed all
.gradle
caches, checked that I'm only importing version
1.2.0-alpha01-753
, same result. Is there any known issue with the iOS
saveable
artifact?
l

Landry Norris

08/05/2022, 2:11 AM
I get the same. I stopped trying for device.
It should work fine on simulator.
d

darkmoon_uk

08/05/2022, 3:36 AM
Thanks for confirming @Landry Norris 👌 It feels wrong to raise a YouTrack against a Dev build; but @Dima Avdeev just in case you aren't already aware of this issue in latest
1.2.0-alpha01
☝️
Notably, when I include the library as project dependency to a Compose/iOS 'dev App' in the same Gradle workspace; everything works fine (yes, on device). It's only when trying to produce the standalone framework artifact that the issue arises. Maybe this has to do with being on an M1 (host being arm64 as well causing some tool-chain ambiguity)? @Landry Norris ☝️
d

Dima Avdeev

08/05/2022, 5:31 AM
Thanks, I will research that error!
Do you have reproduction sample project?
d

darkmoon_uk

08/05/2022, 12:53 PM
Hi @Dima Avdeev, I will DM you regarding repro project.
c

cafonsomota

10/02/2022, 1:04 AM
Were you able to fix this @Dima Avdeev? I’m facing the same issue with 1.2.0-beta02 and Kotlin 1.7.10
d

darkmoon_uk

10/02/2022, 1:06 AM
@cafonsomota I should have posted this earlier: the workaround to this for me was disabling caching for Kotlin Native.
Away from computer at the moment but I think the line in gradle.properties should be: kotlin.native.cacheKind=none
l

Landry Norris

10/02/2022, 1:18 AM
I can confirm that this worked for me too. Also keep in mind that for libraries (framework compilation), all Composable functions have to be private or internal in your iOS and shared code right now. You get a 'no such file for ...' error otherwise
d

darkmoon_uk

10/02/2022, 1:20 AM
@Landry Norris That sounds like it could become a problem for us... Do you have a reference to any issues for that and when it might be resolved?
l

Landry Norris

10/02/2022, 1:26 AM
Not sure. I know I've mentioned the no file for ... error here before. When Touchlab wrote an article about their Droidcon app, they mentioned this, and it worked when I changed all composables to internal. I'd figure this will be fixed prior to stable iOS release.
UIKit support is still experimental, and while the JB team is doing a great job implementing it, there's more functionality they seem to be prioritizing. I saw that popup support just landed for all skiko targets, which is cool, but no Popup method for iOS yet.
d

darkmoon_uk

10/02/2022, 1:29 AM
Thanks for the context
c

cafonsomota

10/02/2022, 10:45 AM
Thanks everyone! I have it now working 🙂
Well, it seems I’ve found another similar issue 😕. I’m using the precompose library, and I get the a similar error when compiling it for iOS (compose). I’ve tried to add it locally and update to the same kotlin/compose version but the error is the same - any idea about what I might be missing?
Copy code
e: Module "moe.tlaster:precompose" has a reference to symbol [ moe.tlaster.precompose.viewmodel.compose/viewModel|3127023112414170874[0] <- local Local[<TP>,0 | TYPE_PARAMETER name:VM index:0 variance: superTypes:[moe.tlaster.precompose.viewmodel.ViewModel] reified:true] ]. Neither the module itself nor its dependencies contain such declaration.
Inline functions are also not supported 🙂 - I’ve made it work by calling another one
w

Wojciech Roczniak

01/10/2023, 7:36 AM
Hi @cafonsomota I have the same problem with precompose and viewModel in iOS. Did you found a solution for it ?
154 Views