I've upgraded my Compose Multiplatform (Android + ...
# compose-ios
a
I've upgraded my Compose Multiplatform (Android + iOS + Desktop) project from
Kotlin 2.1.0-Beta1
to
Kotlin-2.1.0-Beta2
and now I'm getting the following error when building the app to run on iOS Simulator:
Copy code
Undefined symbols for architecture arm64:
  "_kfun:androidx.lifecycle.viewmodel.compose#access$<get-androidx_lifecycle_viewmodel_compose_LocalViewModelStoreOwner$stable>$p$tLocalViewModelStoreOwnerKt(){}kotlin.Int", referenced from:
      _kfun:com.test.RouteA#internal in composeApp[2](ComposeApp.framework.o)
      _kfun:com.test.RouteB#internal in composeApp[2](ComposeApp.framework.o)      _kfun:com.test#TestField(com.test.TestViewModel?;androidx.compose.ui.Modifier?;com.test.TestModel?;kotlin.String?;kotlin.Function0<kotlin.Unit>?;kotlin.Function0<kotlin.Unit>?;kotlin.Boolean;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} in composeApp[2](ComposeApp.framework.o)
      _kfun:com.test.RouteC#internal in composeApp[2](ComposeApp.framework.o)
      _kfun:com.test.RouteD#internal in composeApp[2](ComposeApp.framework.o)
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Android and Desktop builds are working fine. I'm using the following related multiplatform frameworks/libraries: • jetbrains compose: "1.7.0-rc01" • jetbrains lifecycle and viewmodel: "2.8.2" • jetbrains navigation compose: "2.8.0-alpha10" • koin: 4.0.0 I'll appreciate if someone can help.
@arnaud.giuliani Not sure if this is a Koin+ViewModel+Lifecycle issue, but looks like it's happening with ViewModels, and I'm injecting them with
koinViewModel()
.
a
ok, interesting feedback. I need to confirm that on my side too. Did you see anything from the lifecycle KMP lib, in terms of issue?
a
I can't find any further details. That's the only error message that I see.
👍 1
t
I've bumped up against the exact same issue, with much the same dependency load-out: •
org.jetbrains.compose
version
1.7.0
compose-gradle-plugin
org.jetbrains.androidx.lifecycle
version
2.8.3
lifecycle-runtime-compose
lifecycle-viewmodel-compose
org.jetbrains.androidx.navigation
version
2.8.0-alpha10
navigation-compose
io.insert-koin
version
4.0.0
koin-core
koin-android
koin-androidx-compose
koin-compose
koin-compose-viewmodel
koin-test
I've found that using Kotlin
2.1.0-Beta1
and KSP
2.1.0-Beta1-1.0.25
works without an issue, but bumping up to Kotlin
2.1.0-Beta2
and KSP
2.1.0-Beta2-1.0.25
causes my project to consistently throw:
Copy code
Undefined symbols for architecture arm64:
  "_kfun:androidx.lifecycle.viewmodel.compose#access$<get-androidx_lifecycle_viewmodel_compose_LocalViewModelStoreOwner$stable>$p$tLocalViewModelStoreOwnerKt(){}<http://kotlin.Int|kotlin.Int>", referenced from:
      _kfun:com.<redacted>.home.navigation.destination.HomeMainNavigationDestination.com.<redacted>.home.navigation.destination.HomeMainNavigationDestination#HomeMainScreen(androidx.compose.runtime.Composer?;kotlin.Int){} in libcom.<redacted>.home.navigation.destination.-nqckh1.a[2](libcom.<redacted>.home.navigation.destination.-nqckh1.a.o)
      _kfun:com.<redacted>.map.navigation.destination.MapMainNavigationDestination.com.<redacted>.map.navigation.destination.MapMainNavigationDestination#MapMainScreen(androidx.compose.runtime.Composer?;kotlin.Int){} in libcom.<redacted>.map.navigation.destination.-hl17sy.a[2](libcom.<redacted>.map.navigation.destination.-hl17sy.a.o)
      _kfun:com.<redacted>.<redacted>.ComposableSingletons$AppKt.com.<redacted>.<redacted>.ComposableSingletons$AppKt#<init>$lambda$11#static(androidx.compose.runtime.Composer?;kotlin.Int){} in libcom.<redacted>.<redacted>.b1mi0k.a[2](libcom.<redacted>.<redacted>.b1mi0k.a.o)
      _kfun:com.<redacted>.splash.navigation.destination.SplashMainNavigationDestination.com.<redacted>.splash.navigation.destination.SplashMainNavigationDestination#SplashMainScreen(androidx.compose.runtime.Composer?;kotlin.Int){} in libcom.<redacted>.splash.navigation.destination.-prb5st.a[2](libcom.<redacted>.splash.navigation.destination.-prb5st.a.o)
      _kfun:com.<redacted>.splash.presentation.splash.ui#SplashScreen(androidx.navigation.NavHostController?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){} in libcom.<redacted>.splash.presentation.splash.ui.-olzri.a[2](libcom.<redacted>.splash.presentation.splash.ui.-olzri.a.o)
ld: symbol(s) not found for architecture arm64
error: Compilation finished with errors
a
ok intersting
t
Just in case it helps - I've just tested with KSP
2.1.0-Beta2-1.0.26
, and the issue persists.
n
I'm facing the same problem and created an issue: https://youtrack.jetbrains.com/issue/KT-72490
💪 1
a
Upgrading to
Kotlin 2.1.0-RC
fixed this issue for me!
👀 1
amaze 1
👍 2
t
I was about to ask if the appropriate KSP release was out, to go with Kotlin
2.1.0-RC
, and it seems it came out ~50 minutes ago! Damn you’re fast @Armond Avanes! Thanks for testing and confirming you got past the issue with this latest release! kodee happy
👍 1
a
cool 🙂
t
I can confirm that it's definitely resolved these initial issues on my side also, however I'm dealing with something new, now! 🙂 Strange build errors relating to
ComposeExtension
not existing. Never a dull moment 😛
409 Views