https://kotlinlang.org logo
Join Slack
Powered by
# compose-ios
  • t

    Tristan

    08/19/2025, 11:28 PM
    Hello, using KMP Compose 1.8.2 I am having an issue with text fields. When I tap on a text field I get this error
    Copy code
    Can'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
    Copy code
    var textFieldValue by remember {
        mutableStateOf("")
    }
                    
    OutlinedTextField(
        value = textFieldValue,
        onValueChange = { textFieldValue = it },
        singleLine = true,
        modifier = Modifier.width(160.dp)
    )
    And my imports
    Copy code
    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)
    a
    d
    • 3
    • 8
  • d

    DevOpsCraftsman

    08/21/2025, 12:55 AM
    Hello everyone. In my team, we are having a big problem with
    TextField
    (and related) on iOS, it always crashes when we trying to click in it... The sample code:
    Copy 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:
    Copy code
    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
    c
    s
    +3
    • 6
    • 8
  • c

    Calle Höglund

    08/21/2025, 9:34 AM
    Hello everybody! Currently testing around in a CMP project. Im having trouble updating the state inside a swiftUI view.
    Copy code
    @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! 🙏
    r
    • 2
    • 4
  • a

    Alexis

    08/24/2025, 5:09 PM
    Hello, anyone tried to implement Google AdMob native app in ios using Compose Multiplatform? I've figured out how to load an ad's data, but it seem that I need a native view to handle user's click and that I can't simply use a Compose button's onClick callback. I suppose that I should go for a SwiftUI implementation, but before doing so I wanted to know if anyone had success implementing it in Compose 🙂 Thanks for reading and I wish you all a nice day!
    u
    • 2
    • 2
  • s

    Sam

    08/26/2025, 1:33 PM
    Has anyone got previews working on a project with an iOS target in
    commonMain
    ? I keep getting this:
    Copy code
    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',
    a
    i
    • 3
    • 4
  • a

    Alexis

    08/27/2025, 2:44 PM
    Hello everyone! I'm starting a new KMP, and I was wandering if for modular architecture, the use of an "umbrella" KMP module was still the recommended way to expose the share code to ios, or if things had change and we can now export our KMP modules as independant XCFramework?
    ✅ 1
    p
    j
    • 3
    • 7
  • m

    markturnip

    08/28/2025, 8:34 AM
    Compose navigation is really what lets iOS down when building a CMP app. I’m wondering whether I build out my navigation/coordinator flow natively by simply embedding each
    ComposeUIViewController
    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/
    j
    c
    • 3
    • 13
  • a

    aidanvii

    08/28/2025, 1:48 PM
    After upgrading from Meerkat to Narwhal, we've noticed a change in how iOS run configurations are done. We are working in a monorepo with 3 apps, 2 of which are compose multiplatform. Even after setting the working directory to the app we actually want to run, it will always run the other. Obfuscated the names in the screenshot, but for example it would run app-1 instead (the working directory doesn't seem to have any effect here):
    c
    • 2
    • 8
  • g

    Guilherme Delgado

    08/29/2025, 7:48 PM
    Hi everyone, Has anyone recently run into a
    Uncaught 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.
  • d

    Dumitru Preguza

    09/04/2025, 12:04 AM
    When I run the compose app on my physical iPhone from IDEA -> the app builds -> link -> and does not run; no error message or anything else, just does not run and the Run icon becomes available again. Works when I run the same project from XCode
  • m

    Mario

    09/10/2025, 3:21 PM
    Anyone else also seeing this error on Sentry? It doesn't look like a false alarm, and we've had issues report that the app freezes. Impact is around 3% of our userbase. We don't have ANR on Android.
    Copy code
    WatchdogTermination
    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 🙏
    h
    • 2
    • 3
  • a

    andrewreitz

    09/14/2025, 8:41 PM
    Would anyone know if there's more to getting Compose to run on iOS simulator than just this? https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-create-first-app.html#run-your-application-on-ios I setup a new project in Android Studio with compose multiplatform, and the only thing I change from the provided code is adding
    compose.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.
    c
    • 2
    • 7
  • e

    Ezekiel Adetoro

    09/15/2025, 9:11 AM
    Hello all, I have this error while trying out compose multiplatform.
    error: 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?
    j
    c
    +2
    • 5
    • 11
  • f

    ferdialif02

    09/17/2025, 5:18 AM
    When i tried to use Material3 Calendar in compose iOS, it caught on error saying : Uncaught Kotlin exception: kotlin.native.internal.IrLinkageError: Can not get instance of singleton 'System': No class found for symbol 'kotlinx.datetime/Clock.System|null[0]' -depedency : kotlinx datetime : 0.7.1 Material3 : 19.0-beta05
    c
    • 2
    • 2
  • m

    Marek Niedbach

    09/17/2025, 3:05 PM
    Hello, do you know if there was any change related to the a11y on the iOS in latest release of compose (1.9.0)? My whole test suite stops working, and it looks like the issue fixed in 1.7.0 comes back - but there was no info about a11y changes in latest release notes. https://youtrack.jetbrains.com/issue/CMP-7024/Accessibility-for-compound-layouts-is-not-working-on-iOS-correctly My composable like:
    Copy code
    Card(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?
    i
    • 2
    • 1
  • s

    Shariff

    09/17/2025, 8:37 PM
    has anyone experienced an inability to input a phone number on iOS simulators? My app was just rejected by Apple 2x because they were not able to enter the phone number to log on to the app. Im puzzled as I cannot repro this on any simulator or device. Here is my phone number form:
    Copy code
    @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
                }
        }
    }
    m
    • 2
    • 1
  • e

    Ezekiel Adetoro

    09/22/2025, 6:03 PM
    Need help with this error please.
  • j

    James Robinson

    09/24/2025, 10:59 AM
    Has anyone tried using Compose on iOS for smaller subviews, like an image component? I’m curious if people have run into any issues, particularly freezing when a decent number of these components are visible on the same screen.
    a
    • 2
    • 4
  • w

    wisha khn

    09/24/2025, 5:28 PM
    Hey everyone, Has anyone here integrated a Microsoft Azure CI/CD pipeline with a KMP project? We’re running into an issue where, during the build, the pipeline is profiling not only the iosApp target but also the SPM packages. We’re using manual profiling instead of automatic, and this is causing problems. If anyone has faced this and found a solution, your help would be greatly appreciated! 🙏
    c
    • 2
    • 5
  • i

    iQQator

    10/01/2025, 9:16 AM
    Hello all, My questions is about embedding Compose view (not screen) into UIKit/SwiftUI contains project: • How to determine size of view manually (calculate before embed for example)? • We have only UIViewController representation, why not UIView representation exist?
    a
    • 2
    • 1
  • m

    Mateus Bauer

    10/07/2025, 1:54 AM
    Hi, folks! Has anyone solved this yet?
    Uncaught 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):
    Copy code
    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.
    i
    • 2
    • 24
  • k

    Kevin S

    10/09/2025, 5:01 PM
    Hi all! I'm running into a sizing / padding issue. I am using this calendar library in KMP and am passing it into a SwiftUI View. (The Calendars root view is a
    LazyRow
    ). 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
    .
  • e

    Ernestas

    10/10/2025, 8:30 AM
    Hey guys, have there been any news about liquid glass support on CMP?
    z
    j
    +5
    • 8
    • 28
  • j

    James Bowler

    10/15/2025, 4:34 AM
    Is there some trick for getting resources to work in ios archive? https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-multiplatform-resources-setup.html#what-s-next When I run my app, it works great, and my images are there on my iphone, but when i archive, and run, it crashes because it can't find them ..
    kodee happy 1
    • 1
    • 1
  • r

    Rafael Costa

    10/23/2025, 5:05 PM
    Hey guys 👋 - Crash on iOS, only on TestFlight builds We have an iOS application that uses Compose multiplatform on a particular screen. Apparently our local builds are all working, but not TestFlight ones. They crash as soon as we try to show the
    ComposeUIViewController
    -> stack trace in the 🧵, as far as I can see, it happens on
    kfun:androidx.compose.ui.util#trace
    call. Is there any known issue on testflight builds? or anything special that it does that could hint at why this happens?
    a
    • 2
    • 35
  • j

    Jonathan

    10/25/2025, 5:19 PM
    Has anyone used
    SupportingPaneScaffold
    on iOS? I'm encountering a weird bug when rotation the device and the Scaffold seems to be placed in an invalid state where the Main pane and the Supporting are both visible when only a single pane should be visible. There also appears to be a bug in how the
    ThreePaneScaffoldNavigator
    reports the supporting pane is hidden/visible after an orientation change. This does not happen on Android. I'm using version
    1.2.0-beta01
    of the adaptive libraries. But I've tested this behavior all the way down to version
    1.1.0
    . Has anyone encountered this bug and or found a solution or work around?
    Simulator Screen Recording - iPhone 16 - 2025-10-25 at 12.42.12.mp4
    a
    • 2
    • 2
  • f

    ferdialif02

    11/05/2025, 3:51 AM
    Hi, i am currently trying out compose 1.10.0-beta01 and stumbled on this changelog. I am trying to use autoresize uikit without assigning the default value. But it does not work. Here is the code snippet :
    Copy code
    UIKitView(
        factory = {
            val webView =
                wkwebviewInstance(
                    url = url(),
                    token = token,
                    onSizeChange = {
                    },
                    backgroundColor = backgroundColor,
                )
            webView.navigationDelegate = coord
            webView.UIDelegate = coord
            webView
        },
        modifier =
            Modifier
                .fillMaxWidth()
                .wrapContentHeight()
                .background(Color.Transparent),
        update = { webView ->
            webView.backgroundColor = backgroundColor.toUiColor()
            webView.loadHTMLString(url(), null)
        },
        properties = UIKitInteropProperties(placedAsOverlay = true),
    )
  • s

    Saurabh Gupta

    11/05/2025, 6:12 AM
    I am trying to integrate MSAL cocoapod lib into my Kotlin multiplatform mobile app. I have double checked everything and followed all the steps to the T. I am getting following set of errors. It looks like Xcode build is unable to find the MSAL library even though FRAMEWORK_SEARCH_PATHS value in build-settings-iosSimulator-MSAL.properties is correct and MSAL framework is generated at that location. Any pointers?
    Could not find or use auto-linked framework 'MSAL': framework 'MSAL' not found
    Could not parse or use implicit file '/Applications/Xcode-16.2.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it
    Undefined symbol: _OBJC_CLASS_$_MSALInteractiveTokenParameters
    Undefined symbol: _OBJC_CLASS_$_MSALResult
    Undefined symbol: _OBJC_CLASS_$_MSALWebviewParameters
    Linker command failed with exit code 1 (use -v to see invocation)
    Here are my other configuration - 1. Android Studio Narwhal 4 2. XCode 16.2 3. kotlin = "2.2.21" 4. agp = "8.13.0" 5. composeMultiplatform = "1.9.2" 6. MSAL - "2.3.0"
  • s

    Saurabh Gupta

    11/06/2025, 3:25 AM
    I was able to get past this issue by setting
    FRAMEWORK_SEARCH_PATHS
    in the Build settings of the iOSApp target to the MSAL.framework inside
    composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/MSAL
    However, now my app installs but crashes immediately because it is not able to find the MSAL framework not found in the installed app. See errors below -
    Copy code
    Library not loaded: @rpath/MSAL.framework/MSAL
      Referenced from: <31B76893-6B17-3B79-A07A-88B847BB3EAD> /private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/CokeGPT.debug.dylib
      Reason: tried: '/private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/Frameworks/MSAL.framework/MSAL' (no such file), '/private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/MSAL.framework/MSAL' (no such file), '/private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/Frameworks/MSAL.framework/MSAL' (no such file), '/private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/MSAL.framework/MSAL' (no such file), '/private/var/containers/Bundle/Application/D9250FBD-9976-419A-9B63-8D53A65A6C5B/CokeGPT.app/Frameworks/MSAL.framework/MSAL' (no such file)
    🧵 1
  • s

    Saurabh Gupta

    11/06/2025, 6:04 AM
    Finally figured. The issue was detailed in documentation always. I was mixing direct integration with cocoapod integration. You cannot have both and the flag to suppress the warning made it hide under the bed. I went pure Cocoapod integration and MSAL library is integrating as expected.
    Direct integration
    You can connect the iOS framework directly from the Kotlin Multiplatform project by adding a special script to your Xcode project. The script is integrated into the build phase of your project's build settings.
    This integration method can work for you if you do not import CocoaPods dependencies in your Kotlin Multiplatform project.
    If you use the Kotlin Multiplatform IDE plugin, direct integration is applied by default.
    For more information, see Direct integration.
    CocoaPods integration with a local podspec
    You can connect the iOS framework from the Kotlin Multiplatform project through CocoaPods, a popular dependency manager for Swift and Objective-C projects.
    This integration method works for you if:
    • You have a mono repository setup with an iOS project that uses CocoaPods
    • You import CocoaPods dependencies in your Kotlin Multiplatform project
    To set up a workflow with a local CocoaPods dependency, you can either edit the scripts manually.
    For more information, see CocoaPods overview and setup.
    🧵 1
    f
    • 2
    • 3