https://kotlinlang.org logo
Join Slack
Powered by
# multiplatform
  • d

    David Otasek

    11/21/2025, 10:01 PM
    Hi everyone, I have a 3-year old multiplatform project (jvm, js, ktor, react, redux components) that I'm having some difficulty trying to update to newer multiplatform versions. I tried to follow the commit history on the [jvm-js-fullstack](https://github.com/kotlin-hands-on/jvm-js-fullstack/tree/final) example to get to at least the 1.0.0-pre.561 version of the kotlin wrappers. That got my project to build, and the server side appears to work as intended, but the react and redux front end of it is failing in the browser. My attempt at the update can be seen here: https://github.com/hapifhir/org.hl7.fhir.validator-wrapper/compare/do-20251121-bump-kotlin-multiplatform The issues stem from redux from what I can tell.
    The slice reducer for key "localizationSlice" returned undefined during initialization.
    is what I can see in the browser console. I can get rid of that exception with some changes, but that leads to other runtime errors and I can't tell if it's actually an improvement. If anyone has any ideas on the path I should take, or suggestions on more appropriate places to ask for help, please let me know.
  • w

    Wayne

    11/21/2025, 10:42 PM
    Hi folks, I'm working on a Compose Multiplatform project that mixes native and compose UIs. I'm using a NativeViewFactory pattern where some views are defined in an interface and implemented in Swift, which is then injected. This is possible because the entrypoint of the app is Swift, where it can define an implementation and pass it into the Kotlin side. I'm running into a problem with testing, where I am testing Composables in a more isolated fashion, and more importantly, from a Kotlin entrypoint (in commonTest). It's a composeUiTest. At this point there is no injected NativeViewFactory, so the test can't proceed on iOS. Is there an existing pattern for testing Composables with Swift views embedded within? Seems like it would require a way to call Swift code before calling the composable. Or is there another method? Thanks!
    f
    • 2
    • 3
  • p

    Phodal

    11/22/2025, 5:17 AM
    Hi folks, I’m using compose-webview-multiplatform to embed a WebView in my application. However, in production it still requires downloading KCEF, which is difficult for some users. I’m trying to find a way to bundle it with the JetBrains Runtime (JBR), but I haven’t found any useful resources or documentation. Does anyone have suggestions for alternative WebView solutions that can be shipped without requiring users to download KCEF?
    👀 2
  • s

    Sajid Ali

    11/22/2025, 8:14 AM
    Hey everyone, I am trying to bundle libvlc as a kotlin multiplatform library but when I use it in swift I get "Framework VLCKit not found" error.
    Copy code
    plugins {
        alias(libs.plugins.android.kotlin.multiplatform.library)
        alias(libs.plugins.kotlinMultiplatform)
        alias(libs.plugins.kotlinCocoapods)
    }
    
    kotlin {
        jvmToolchain(17)
    
        androidLibrary {
            namespace = "dev.sajidali.onplayer.vlc"
            compileSdk = 35
            minSdk = 21
        }
    
        jvm("desktop")
    
        val xcfName = "VlcKit"
        listOf(
            iosSimulatorArm64(),
            iosArm64(),
            iosX64(),
            tvosX64(),
            tvosArm64(),
            tvosSimulatorArm64(),
    //        macosArm64(),
    //        macosX64()
        ).forEach {
            it.binaries.framework {
                baseName = xcfName
    //            linkerOpts.add("-framework")
    //            linkerOpts.add("VLCKit")
                isStatic = false
            }
        }
    
        cocoapods {
            summary = "Shared LibVLC Implementaion"
            homepage = ""
            version = "1.0"
            ios.deploymentTarget = "18.0"
            tvos.deploymentTarget = "18.0"
    //        osx.deploymentTarget = "15.0"
    
            framework {
                isStatic = false
                baseName = xcfName
            }
    
            pod("VLCKit") {
                version = "4.0.0a16"
                extraOpts += listOf("-compiler-option", "-fmodules")
            }
        }
    
        sourceSets {
            commonMain {
                dependencies {
                    api(project(":oneplayer"))  // Consider making this api if you want to export it too
                    implementation(libs.kermit)
                }
            }
    
            androidMain {
                dependencies {
                    implementation(libs.core.ktx)
                    implementation(libs.appcompat)
                    implementation(libs.constraintlayout)
                    // Add LibVLC dependency
    //                implementation(libs.libvlc.all)
                }
            }
    
            appleMain {
                dependencies {
                    // Any iOS-specific dependencies
                }
            }
        }
    }
    This is my gradle config. What am I doing wrong?
    f
    • 2
    • 1
  • e

    electrolobzik

    11/22/2025, 9:01 PM
    Hey everyone, Is it still expected that debugging a suspend function on iOS (in both Xcode and Android Studio) doesn't show the local variables and method parameters? I've set a breakpoint inside suspend function and it stops but doesn't show anything, and if I try to add a watch for the method parameter it says: "error: user expression 1311: use of undeclared identifier". Am I doing something wrong or this limitation is still there?
    t
    • 2
    • 2
  • r

    RANJAN

    11/23/2025, 8:39 PM
    Hey everyone. Earlier when we created KMP app with shared UI logic too. It would have provided
    composeApp
    and
    shared
    modules. and shared would be containing logic till domain layer. But after migrating my application to domain and started composeApp module with UI and viewmodel I realised in composeApp don't have way for viewmodel to be initialised via
    koin
    .(If have way then please let me know) But now when we create new project using KMP plugin it do not provide shared module instead official documentation suggest to put shared logics in same module too. My question: is KMP really stable. without knowing it changed a lot in 4-5 months for me. Can it be trusted.
    m
    • 2
    • 3
  • c

    Colton Idle

    11/24/2025, 2:01 AM
    kotlin docs state "To make the update process smoother in the long term, we recommend changing your project structure to isolate AGP usage to a dedicated Android module." But when you download a new project from https://kmp.new it doesn't have a dedicated android module (but it does have a dedicated ios module?) should kmp.new template project be updated?
    z
    e
    e
    • 4
    • 6
  • b

    Bhadra Vaghela

    11/24/2025, 5:35 AM
    I’m facing an issue with my KMP project - it’s not building in Android Studio. I’m continuously getting an error, and I’ve attached the log/error screenshot for your reference. Please have a look and let me know what might be causing this or how I can resolve it. Thanks!
    t
    • 2
    • 3
  • f

    François-Xavier Beuvry

    11/24/2025, 9:02 AM
    Hello everyone! We are currently developing a KMP library targeting both Android and iOS, with @Aurélien L.M. Our main challenge is with the data type mapping for iOS. • When exposing integer types from common Kotlin code to the iOS side, they are mapped to the standard Objective-C types (e.g.,
    Int16
    ,
    Int32
    ,
    Int64
    , etc.). • However, the iOS developers in my company are primarily using Swift, and they strongly prefer to use the standard Swift
    Int
    (which, on modern 64-bit architectures, is effectively a 64-bit integer,
    Int64
    ). They are reluctant to deal with the specific Objective-C-derived integer types (
    Int32
    ,
    Int64
    , etc.) as it breaks Swift idiomatic usage and requires constant casting. I initially suggested exposing the numbers as
    NSNumber
    , but this was also rejected for similar reasons (non-idiomatic Swift). My question is: Is there an established, idiomatic way (a KMP feature, a specific wrapper, a build setting, or a best practice) to make KMP expose Kotlin integer types (especially
    Int
    and
    Long
    ) in a way that maps directly to the standard Swift
    Int
    type, or at least something closer to it than the current Obj-C derived types? I suspect this question has come up before, but I haven't been able to find a clear solution or discussion thread. Any advice or pointer would be greatly appreciated! Thanks!
    s
    e
    e
    • 4
    • 4
  • g

    Gustavo E Bonilla

    11/24/2025, 10:52 AM
    Hello everyone, Currently in our team we are building a KMP app using the Kotlin code for the shared logic, but each platform handling its own ui (✏️ & swift) independently. Right now we are facing an issue when we want to debug the share code in XCode a problem of unsymbolicated crash reports due to the dsym files are missing. Currently we are following the approach suggested here, but still no dsym files are being generated. Has someone already faced this? or have a different approach that will fulfill this requirement? Thanks in advance 🙂 .
    a
    f
    • 3
    • 4
  • a

    Alexandru Caraus

    11/24/2025, 11:05 AM
    Hello Everyone, I want to create a small plugin in buildSrc for Kotlin Multiplatform, so that when I apply my custom configuration it would build selectively the source sets. Lets say I am on linux, and have iosMain target, I want to disable this target in the whole project with a flag. Do you have any ideas where I could start?
    z
    • 2
    • 2
  • s

    Smoothie

    11/24/2025, 3:11 PM
    Hello, I'm still looking for any solution to this, it make checking logs really exhausting. iOS logs on Android Studio or Intelij are double line return
    • 1
    • 1
  • d

    Dumitru Preguza

    11/24/2025, 3:46 PM
    Is there any lib to make the functionality "Share with another app" multiplatform on mobile ?
    h
    m
    • 3
    • 4
  • l

    liverm0r

    11/24/2025, 10:15 PM
    Hey, does anyone know if it possible to have the android like compose preview with desktop only KMP app? I tried
    Compose Multiplatform for Desktop IDE support
    but it doesn't allow to click on a view and move cursor into the code.
    z
    • 2
    • 1
  • k

    Karen Frangulyan

    11/25/2025, 3:29 AM
    Hey! Can it happen that something from “regular” Jetpack Compose doesn’t end up in “multiplatform” Compose? For example, compose foundation added
    plus
    and
    minus
    operators for
    PaddingValues
    in 1.10.0-alpha05 , however, CMP
    1.10.0-beta02
    (which is based on jetpack compose of the same version) doesn’t seem to have those operators.
    j
    • 2
    • 2
  • s

    Simileoluwa Aluko

    11/25/2025, 6:44 AM
    Hey here, I had started building a compose multiplatform app targeting Android & iOS, then decided to try compose hot reload to see if it'd save me time refreshing the app. After setting it up, and making changes in commonMain (most of my code live here) the changes don't seem to appear on the desktop app automatically or immediately. Am I missing something or its only changes to jvmMain that'd appear immediately on the desktop app?
    z
    • 2
    • 18
  • y

    ymaskin

    11/25/2025, 2:49 PM
    Hey, After upgrading the compose plugin in a CMP project, I'm getting this on iOS only. All the text fields are displaying random characters stuck on each other. Have you faced something similar? Any idea of how to solve this?
    a
    • 2
    • 7
  • m

    markturnip

    11/27/2025, 9:30 AM
    Anyone know of a Compose Multiplatform component for securing views from screen capture?
    v
    • 2
    • 4
  • d

    Damjan Miloshevski

    11/27/2025, 11:36 AM
    Hello, the Multiplatform app runs successfully on iPhone 13 and iOS 26.1 but I get this message in Android Studio, is this some kind of bug in the Studio itself or I need to update some plugins? I also have macOS Tahoe 26.1
    z
    • 2
    • 7
  • p

    pablisco

    11/27/2025, 12:40 PM
    Hey folks 👋 We are getting a very odd issue. We have a kmp project with android, desktop, ios and wasm. We also have something in our gradle that allows us to enable and disable targets to avoid compilation time (this would be a nice feature request btw) Anywho, when we have desktop and android, ksp doesn't generate code for kotlins.serialisation or Koin. However, if we have either of those enabled, they work ok. And, once compiled, if we have both android and desktop enabled together again, it works fine. Only has issues after a clean. Has anyone experienced something like this before?
    s
    • 2
    • 4
  • b

    Bhadra Vaghela

    11/27/2025, 1:36 PM
    Hey folks, I’m working on a Kotlin Multiplatform (KMP) Desktop project and I want to share it with others as a Windows executable (.exe) so it can run on any PC without needing Android Studio. Can anyone guide me on: • How to export or generate a .exe build from a KMP Desktop project.
    m
    m
    • 3
    • 4
  • b

    Brill

    11/27/2025, 2:46 PM
    Reading up on the experimental Compose UI tests at https://kotlinlang.org/docs/multiplatform/compose-test.html#what-s-next I'm thinking we really need to separate unit test from Ui Tests. Does anyone know the thought on combining them?
    o
    • 2
    • 7
  • s

    Stylianos Gakis

    11/27/2025, 3:23 PM
    I have an expect in my commonMain in a module with targets for jvm, android and iOS. Is there a way for me to make a sourceset which will combine both android and jvm, while still being able to use code in there which comes from jvm targets of libraries that I am using? More specifically, I want to use
    kotlinx.datetime.toJavaLocalDate
    which comes from inside kotlinx.datetime, which is defined in the jvm target. If I have the android and the jvm source sets separately, each one of them can import this function and just use it, no problem. However if I make a new sourceset like:
    Copy code
    applyDefaultHierarchyTemplate()
    val jvmAndAndroidMain by creating {
     dependsOn(commonMain.get())
    }
    jvmMain.get().dependsOn(jvmAndAndroidMain)
    androidMain.get().dependsOn(jvmAndAndroidMain)
    it is not resolved since as I understand it can't figure out that both those targets are supposed to be able to call the jvm target of the kotlinx.datetime library. Perhaps there might be a way to make this happen by not using the
    applyDefaultHierarchyTemplate
    and doing something more custom?
    o
    j
    • 3
    • 22
  • m

    Mikolaj

    11/27/2025, 6:06 PM
    The environment preflight check feature in KMP plugin for AS complains about empty emulators directory in Android SDK dir. If there is someone from JB reading - Maybe this requirement can be lifted? Emulator is not needed to start KMP app on physical device
    z
    • 2
    • 1
  • k

    Karen Frangulyan

    11/27/2025, 8:41 PM
    Hey! I am seeing a minor Preview issue: when running a preview on my physical device - an Action Bar is displayed on top, which partially covers the component I’m previewing. It’s a KMP/CMP project, multi-module, running a Preview from one of the KMP module’s commonMain, the main app’s theme has all the *.NoActionBar parents (the module’s manifest is empty though, no themes). Currently I just add top padding in preview composable to push stuff down, maybe someone knows a way to get rid of the action bar?
  • j

    Jack Boyce

    11/27/2025, 11:21 PM
    Can anyone recommend a KMP library for string resources? I have a Compose app where certain pieces of code need to be able to run in headless mode, which Compose resources doesn't support (CMP-8068). I see issue KT-63189 but am wondering if there's a 3rd party option. I only need simple retrieval of static strings.
    j
    • 2
    • 2
  • d

    Daria Voronina [JB]

    11/28/2025, 8:38 AM
    📣 Final call! The Kotlin Multiplatform Survey closes soon! Have you tried Compose Multiplatform for iOS, the new Kotlin Multiplatform IDE plugin, or Compose for Web? Tell us how these updates have changed your workflow — your feedback directly shapes what we build next. 👉 Take the survey
    K 1
  • m

    Michal Klimczak

    11/28/2025, 9:00 PM
    Why do I get
    w: Xcode Version Too High for Kotlin Gradle Plugin
    despite kotlin 2.2.20 🧵
    • 1
    • 2
  • j

    Jeremie D

    11/29/2025, 12:08 AM
    Ok… so i finally got as far as creating a kmp module, importing all my ktor and repositories over, as well as some stateholders and one viewmodel. Seems to work really well so far. The hope is to for now keep the views as Is but replace all the ios viewmodels with my kmp ones. I have some questions about lifecycle management- im using koin but will it know the right lifecycles for viewmodels in ios? How does that work? Also im curious to see preferred ways to observe changes on a vm- i saw some stuff from chat gpt where you can write a extension function to make the stateflow observable and post new values to the @published vars on ios. Is that the right thing? Is stateflow the correct way? Right now we were usng mutable state so id prefer to keep that if its good enough/possible
    p
    • 2
    • 2
  • m

    Michal Klimczak

    11/29/2025, 9:57 AM
    CMP + cocapods (google maps) + debug ios build + running from xcode = fail 🧵
    • 1
    • 1