https://kotlinlang.org logo
Join Slack
Powered by
# compose-ios
  • 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
    +7
    • 10
    • 30
  • 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),
    )
    a
    • 2
    • 2
  • 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
    • 4
  • m

    Mark

    11/08/2025, 9:24 AM
    I notice that when using
    FontStyle.Italic
    on iOS (default device font) it’s an extreme (looks double) level of italic. This happens regardless when using
    SpanStyle
    or setting on
    Text
    composable. However, when combined with
    FontWeight.Bold
    then it looks normal-level italic (same as on Android) with bold weight, as expected. This looks really bad if you have a line of text all in italics but a mix of bold and normal weights. Here you can see the different weights applied to letter “I”. First, is no weight (normal), followed by W100….W900
    👀 1
    • 1
    • 1
  • u

    ursus

    11/08/2025, 11:57 PM
    Can someone explain to me what the relation of CMP and material design? Is it a fork as well or is it the one developed by google, i.e. I can use latest alpha to get the
    material 3 expressive
    (or do I have to wait for jetbrains to support it)
  • m

    Mark

    11/09/2025, 10:39 AM
    When using jetbrains compose navigation on iOS, I notice the back gesture does not dismiss dialogs. Instead, it pops the underlying screen. On Android, the same code works fine. Anyone else experienced this? Any workaround?
    k
    • 2
    • 2
  • s

    sunbreak

    11/10/2025, 7:23 AM
    https://youtrack.jetbrains.com/issue/CMP-9250/iOSInteropView-handles-tap-when-scrollable-layout-flings
  • s

    sunbreak

    11/10/2025, 7:24 AM
    Found an InteropView issue and got a workaround. Hope official fix soon
    🧵 1
  • s

    sunbreak

    11/10/2025, 7:25 AM
    https://github.com/JetBrains/compose-multiplatform-core/pull/2557
    🧵 1
    🔥 1
    c
    j
    • 3
    • 2
  • f

    ferdialif02

    11/11/2025, 4:19 AM
    Hi !, so i have exam features in which i load the question and options from html and if the keyboard popped up or focused, and i tried to navigate to other page, the other page would randomly blank :
    Copy code
    @OptIn(ExperimentalTime::class)
    @Composable
    fun PagerWkWebViewTest() {
        val state = rememberPagerState { 10 }
        HorizontalPager(state = state) {
            Column(horizontalAlignment = Alignment.CenterHorizontally) {
                PlatformSpecificWebView(
                    modifier =
                        Modifier
                            .fillMaxWidth()
                            .height(100.dp)
                            .background(Color.Transparent)
                            .clickable {
                            }.animateContentSize(),
                    url = {
                        loadHtmlDataIntoWebView(
                            "<p>Unknown</p>",
                            isAnswer = true,
                            isOptions = true,
                        )
                    },
                    token = "",
                    popBack = {},
                    isLiveClass = false,
                    examMode = true,
                    backgroundColorExam = Color.White,
                    optionExamId = -1,
                    isOption = false,
                )
                TextField(
                    value = "",
                    onValueChange = {},
                    modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp),
                )
            }
        }
    }
    Copy code
    val coord =
        remember {
            WKWebViewExamCoordinator(onSizeChange = {
                heightWebView = it.dp
            })
        }
    if (examMode) {
        UIKitView(
            factory = {
                val webView =
                    wkwebviewInstance(
                        url = url(),
                        token = token,
                        onSizeChange = {},
                        backgroundColor = Color.Transparent,
                    )
                webView.navigationDelegate = coord
                webView.UIDelegate = coord
                webView
            },
            modifier = Modifier.fillMaxWidth().height(heightWebView),
            update = { webView ->
                webView.backgroundColor = backgroundColor.toUiColor()
                webView.loadHTMLString(url(), null)
            },
            onRelease = {
                println("onRelease called on ${url()}")
                it.stopLoading()
                it.removeFromSuperview()
                it.navigationDelegate = null
                it.UIDelegate = null
            },
            properties = UIKitInteropProperties(placedAsOverlay = false),
        )
  • d

    dhia chemingui

    11/11/2025, 9:56 AM
    I dont know why I still get this
    Copy code
    pod("GoogleMaps") {
         version = "~> 8.0.0"
         git("<https://github.com/googlemaps/ios-maps-sdk>")
         extraOpts += listOf("-compiler-option", "-fmodules")
     }
        framework {
                baseName = frameworkName
                isStatic = false
            }
       version = "1.16.2"
    
            ios.deploymentTarget = "17.2"
    
    
            homepage = "<https://example.com/composeApp>"
    
            license = "MIT"
    
            summary = "Shop App"
    
            podfile = project.file("../iosApp/Podfile")
    Copy code
    platform :ios, '17.2'
    use_modular_headers!
    use_frameworks!
    
    target 'iosApp' do
    
        pod 'composeApp', :path => '../ComposeApp'
        pod 'GoogleMaps', '~> 8.0.0'
    #     pod 'MyFatoorah', :git => '<https://dev.azure.com/myfatoorahsc/_git/MF-SDK-iOS-Demo>'
    end
    ld: framework 'GoogleMapsBase' not found I cant know why
  • d

    dhia chemingui

    11/11/2025, 9:59 AM
    I try to do this
    🧵 1
  • d

    dhia chemingui

    11/11/2025, 12:03 PM
    I change nothing , the app run just I take a break of 1 hour and back it run I wish will archive but the ios is always confusing any ticks helps thanks
    🧵 2
    f
    • 2
    • 2
  • m

    Mark

    11/27/2025, 7:31 AM
    Curious what min iOS version you are supporting. CGPT seems to think iOS 16 which means the iPhone 8 (released 8 years ago) or later. iOS 16 seems like a big upgrade, particularly regarding Swift UI though that is potentially irrelevant when using CMP. However, lots of other stuff like PhotoPicker etc.