Christopher Mederos
08/05/2025, 5:29 AMcollectAsStateWithLifecycle
stops getting new values after restoring a view model after navigation.
However, collecting without lifecycle does keep updating
@Composable
fun MyScreen(viewModel: MyViewModel = koinViewModel()) {
val scope = rememberCoroutineScope()
// collectLatest: Does Update
scope.launch {
viewModel.uiState.collectLatest { state -> println("collectLatest Id: ${state.id}") }
}
// collectAsState: Does Update
val uiState by viewModel.uiState.collectAsState()
Text("collectAsState Id: ${uiState.id}: ")
// collectAsStateWithLifecycle: Does NOT Update
val uiStateWithLifecycle by viewModel.uiState.collectAsStateWithLifecycle()
Text("collectAsStateWithLifecycle Id: ${uiStateWithLifecycle.id}: ")
}
Any ideas on where I should go looking for a fix?Javier RG
08/06/2025, 2:17 PMtylerwilson
08/15/2025, 1:43 AMIsmail
08/15/2025, 6:00 PM@Composable
actual fun PlatformBottomNavigation(
selectedTabIndex: Int,
onTabSelected: (Int) -> Unit,
navigateToSettings: () -> Unit
) {
val factory = LocalNativeViewFactory.current
UIKitViewController(
factory = {
factory.createBottomNavigation(
selectedTabIndex = selectedTabIndex,
onTabSelected = onTabSelected,
navigateToSettings = navigateToSettings
)
},
modifier = Modifier
.fillMaxWidth()
)
}
faogustavo
08/18/2025, 1:55 PMFarhazul Mullick
08/18/2025, 5:24 PM# kotlin = "2.1.20" compose = "1.8.2", jbNavigation = "2.8.0-alpha08"
# kotlin = "2.1.10" compose = "1.8.2" jbNavigation = "2.8.0-alpha08"
# kotlin = "2.1.10" compose = "1.8.2" jbNavigation = "2.8.0-alpha10"
Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Can not read value from backing field of property 'androidx_compose_animation_core_SeekableTransitionState$stable': Private backing field of property declared in module <org.jetbrains.compose.animation:animation-core> can not be accessed in module <org.jetbrains.androidx.navigation:navigation-compose>
Tristan
08/19/2025, 11:28 PMCan't show file for stack frame : <DBGLLDBStackFrame: 0x149e1ea90> - stackNumber:0 - name:kfun:kotlin.coroutines.Continuation#<get-context>(){}kotlin.coroutines.CoroutineContext-trampoline. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/libraries/stdlib/src/kotlin/coroutines/Continuation.kt
And the text field I am using
var textFieldValue by remember {
mutableStateOf("")
}
OutlinedTextField(
value = textFieldValue,
onValueChange = { textFieldValue = it },
singleLine = true,
modifier = Modifier.width(160.dp)
)
And my imports
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
Do you think I am missing something? Other UI elements work fine (buttons and checkboxes)DevOpsCraftsman
08/21/2025, 12:55 AMTextField
(and related) on iOS, it always crashes when we trying to click in it...
The sample code:
@Composable
@Preview
fun App() {
TextField(value = "Type", onValueChange = {})
}
The srceenshot of the app in the simulator and the crash
We tested with compose 1.8.2, 1.8.1, and 1.8.0.
For iOS: 18 and 17.
EDIT: we are using the 2.9.1 version of the life cycle view mode compose lib, so the proposed fix proposed in thread of the post above doesn't work...
The crash error message:
Can't show file for stack frame : <DBGLLDBStackFrame: 0x12c607040> - stackNumber:0 - name:kfun:kotlin.coroutines.Continuation#<get-context>(){}kotlin.coroutines.CoroutineContext-trampoline. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/libraries/stdlib/src/kotlin/coroutines/Continuation.ktCan't show file for stack frame : <DBGLLDBStackFrame: 0x11c60ab40> - stackNumber:1 - name:kfun:kotlin.coroutines.native.internal.ContinuationImpl#<init>(kotlin.coroutines.Continuation<kotlin.Any?>?){}. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.ktCan't show file for stack frame : <DBGLLDBStackFrame: 0x11c60ab40> - stackNumber:1 - name:kfun:kotlin.coroutines.native.internal.ContinuationImpl#<init>(kotlin.coroutines.Continuation<kotlin.Any?>?){}. The file path does not exist on the file system: /opt/buildAgent/work/2d153abd4d2c0600/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt
Calle Höglund
08/21/2025, 9:34 AM@Composable
actual fun NativeButton(
enabled: Boolean,
onClick: () -> Unit,
modifier: Modifier
) {
val factory: NativeViewFactory = LocalNativeViewFactory.current
UIKitViewController(
modifier = modifier,
factory = {
factory.createNativeButton(
enabled = enabled,
onClick = onClick,
)
}
)
}
Changing the enabled flag is not updating the UI in SwiftUI. How do i achieve this? Any suggestions?
Thanks! 🙏Alexis
08/24/2025, 5:09 PMSam
08/26/2025, 1:33 PMcommonMain
?
I keep getting this:
No matching variant of org.jetbrains.compose.ui:ui-tooling-preview:1.9.0-beta03 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64',
Alexis
08/27/2025, 2:44 PMmarkturnip
08/28/2025, 8:34 AMComposeUIViewController
in the UINavigationController
However it seems @Kashismails has put together a working demo using Voyager.
I wonder if anyone else is using a setup like this and in production?
https://www.droidcon.com/2024/09/06/using-native-ios-navigation-from-compose-multiplatform/aidanvii
08/28/2025, 1:48 PMGuilherme Delgado
08/29/2025, 7:48 PMUncaught Kotlin exception: org.jetbrains.compose.resources.MissingResourceException: Missing resource with path:
(runtime exception) when running a CMP project through Xcode? The strange thing is that the same project runs fine when launched from Android Studio.
This happens when using Swift Export.Dumitru Preguza
09/04/2025, 12:04 AMMario
09/10/2025, 3:21 PMWatchdogTermination
Level: Fatal
The OS watchdog terminated your app, possibly because it overused RAM.
I haven't been able to pinpoint it to a single reason. It may happen shortly after launch, or after an hour of usage. There are three screens where it most commonly happens (58%, 27%, 18% or 3% others). Happens for many iOS versions & models (even top-end like iPhone 16 Pro).
It completely crashes our app, so it's pretty important. Where should I look next? Thank you 🙏andrewreitz
09/14/2025, 8:41 PMcompose.ios.resources.sync=false
to the gradle.properties reason. When I click the run button I just get the message "Build failed in 1 sec" on the messages tab, and if I check the build tab it shows everything was successful. No other output. Any help would be greatly appreciated.Ezekiel Adetoro
09/15/2025, 9:11 AMerror: Cannot query the value of this provider because it has no value available. * What went wrong:
Execution failed for task ':composeApp:syncComposeResourcesForIos'.
> Cannot query the value of this provider because it has no value available.
And in XCode, I have this error: /KMP/iosApp/iosApp/ContentView.swift:3:8 No such module 'ComposeApp'
. I have tried to apply many solution i foound online which does not work. I tried to use ./gradlew composeApp:syncComposeResourcesForIos
I got: > Task :composeApp:syncComposeResourcesForIos FAILED. * What went wrong:
Execution failed for task ':composeApp:syncComposeResourcesForIos'.
> Error while evaluating property 'xcodeTargetArchs' of task ':composeApp:syncComposeResourcesForIos'.
> Could not infer iOS target architectures. Make sure to build via XCode (directly or via Kotlin Multiplatform Mobile plugin for Android Studio)
. What am I doing wrong? How can I solve this issue?ferdialif02
09/17/2025, 5:18 AMMarek Niedbach
09/17/2025, 3:05 PMCard(modifier = Modifier.testTag("card").clickable {}) {
Text("Foo", modifier = Modifier.testTag("title"))
Text("Bar", modifier = Modifier.testTag("subtitle"))
}
stops working, whats more - the “Foo” nor “Bar” is not exposed as “label” on the iOS. I tried juggling with mergeDescendants
but nothing helps. Any idea how to have both the clickable container and the accessibility access to the inner components?Shariff
09/17/2025, 8:37 PM@Composable
fun PhoneNumberTextField(
phoneNumber: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
isError: Boolean = false
) {
val numericRegex = Regex("[^0-9]")
RadiusOutlinedTextField(
modifier = modifier,
value = phoneNumber,
onValueChange = {
val stripped = numericRegex.replace(it, "")
// Allow editing by limiting to 10 digits only during input
onValueChange(if (stripped.length > 10) {
stripped.substring(0, 10)
} else {
stripped
})
},
placeholder = "Phone Number",
singleLine = true,
visualTransformation = NanpVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Phone),
isError = isError
)
}
class NanpVisualTransformation : VisualTransformation {
override fun filter(text: AnnotatedString): TransformedText {
val trimmed = if (text.text.length >= 10) text.text.substring(0..9) else text.text
var out = if (trimmed.isNotEmpty()) "(" else ""
for (i in trimmed.indices) {
if (i == 3) out += ") "
if (i == 6) out += "-"
out += trimmed[i]
}
return TransformedText(AnnotatedString(out), phoneNumberOffsetTranslator)
}
private val phoneNumberOffsetTranslator = object : OffsetMapping {
override fun originalToTransformed(offset: Int): Int =
when (offset) {
0 -> offset
// Add 1 for opening parenthesis.
in 1..3 -> offset + 1
// Add 3 for both parentheses and a space.
in 4..6 -> offset + 3
// Add 4 for both parentheses, space, and hyphen.
else -> offset + 4
}
override fun transformedToOriginal(offset: Int): Int =
when (offset) {
0 -> offset
// Subtract 1 for opening parenthesis.
in 1..5 -> offset - 1
// Subtract 3 for both parentheses and a space.
in 6..10 -> offset - 3
// Subtract 4 for both parentheses, space, and hyphen.
else -> offset - 4
}
}
}
Ezekiel Adetoro
09/22/2025, 6:03 PMJames Robinson
09/24/2025, 10:59 AMwisha khn
09/24/2025, 5:28 PMiQQator
10/01/2025, 9:16 AMMateus Bauer
10/07/2025, 1:54 AMUncaught Kotlin exception: org.jetbrains.compose.resources.MissingResourceException
I am facing this issue whenever I build the release XcFramework and try to run it. I don't know what's happening, since I am using the following settings(and that shoudn't happen):
composeMultiplatform = "1.9.0"
kotlin = "2.2.20"
It was supposed to should work fine after CMP 1.8.2.
Also, I can confirm that the resources are present in both simulator and arm64 frameworks, inside the XcFramework. I am running out of options, already read all things related and checked everything.Kevin S
10/09/2025, 5:01 PMLazyRow
). I am then wrapping it in a ComposeUIViewController
and then wrapping that in a UIViewControllerRepresentable
on the Swift side. The problem is that I cannot get the height to fit. By default without any modifiers it doesn't show up at all. Then if use scaledToFit
/ scaledToFill
there's a large space under the actual component. I've determined that the blank space underneath is on the SwiftUI side. I've tried various methods to get it working but nothing seems to work out well. The closest I got was following John O'Reillys post about it, which gets the correct height but has a long delay before showing the UI. Any suggestions?
This is with Compose Plugin 1.8.2
.Ernestas
10/10/2025, 8:30 AMJames Bowler
10/15/2025, 4:34 AM