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

    Chirag Redij

    10/25/2025, 10:40 AM
    Hello people, anybody using kotlin version 2.2.20, I am in a tough spot deciding if I should go with kotlin 2.2.10 and use Touchlab SKIE. Can you let me know which one would you prefer and why?
    m
    e
    • 3
    • 3
  • z

    Zyle Moore

    10/25/2025, 8:22 PM
    For a multiplatform library, not an application, should I commit the yarn.lock to source control? The library is just a lot of `interface`s
    r
    • 2
    • 1
  • k

    Karen Frangulyan

    10/26/2025, 12:17 AM
    I know we have
    BackHandler
    in CMP now. But how can I call the back press handler manually, for example, on a button click? On Android I can simply use
    LocalOnBackPressedDispatcherOwner.current
    and I can be sure that the correct back press logic will work, like calling a
    BackHandler
    if someone installed it, or falling back to nav controller if not (I’m on Nav2). Is there something similar in CMP?
    v
    • 2
    • 3
  • g

    Giorgi

    10/26/2025, 12:23 PM
    Hi. do you guys know if there is a library that scrapes youtube recommendations? if it works on both android and JVM that would be even better
    not kotlin but kotlin colored 2
    • 1
    • 1
  • v

    Vinay

    10/26/2025, 4:27 PM
    Hi team, Could you please help me understand the best approach for this setup? I currently have an app with separate packages for Android and iOS — both are fully implemented but maintained independently. Now, I want to migrate this app to Kotlin Multiplatform (KMP). I’m a beginner, so I’m a bit confused about the right way to proceed. Initially, I created a new KMP package and started re-implementing the logic from the Android package into the
    commonMain
    and
    androidMain
    modules. However, since the entire implementation already exists in the Android package, I’m wondering if redoing it in KMP adds much value. I also considered another approach: keeping both the Android and KMP packages locally, making the KMP module a library, and adding it as a dependency in the Android project. Then, I could move the shared code into the KMP module while keeping Android-specific files in the Android package. Could you please suggest which approach is better? Also, note that the Android and iOS packages are currently built using different build systems. And to get the app fully working in KMP, do I need to make changes only in the KMP package or in both the Android and KMP packages?
    r
    • 2
    • 12
  • a

    Azim Ansari

    10/27/2025, 7:36 AM
    Hi Team, Do we have any good article or sample to demonstrate publishing a closed source multi-platform library in including android, jvm and ios? I am having a hard time setting up proguard and javadocs in jvm.
    j
    • 2
    • 2
  • h

    Horatio Thomas

    10/27/2025, 10:58 AM
    is there a way to do partially native ui and partially compose on ios or do you have to choose one or the other?
    j
    s
    • 3
    • 6
  • s

    Smoothie

    10/27/2025, 3:30 PM
    Hello, any way to embed a framework inside the framework built by KMP ? I have a kmp lib gradle module that link against a swift module (.framework), and a cmp project that consume the kmp lib. The problem is that I must embed the swift module in the final CMP application, I wish it was just embed by the kmp lib itself. Thank's
    r
    • 2
    • 1
  • h

    Hieu Vu

    10/27/2025, 3:35 PM
    Hi folks, I am implementing OAuth in iOS with GoogleSignIn and trigger it in CMP view. I face strange error when code runs through GoogleSignIn code. Do I miss something in the set up? I already add
    -ObjC
    flag, add dependencies from nativeBridge to XCode project (as per spmforkmp log says) So I used spmforkmp to get dependencies and implement it in Swift, then call it in Kotlin code. However, when the code run through GoogleSignInCode, it throws this error
    Copy code
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OIDAuthorizationService presentAuthorizationRequest:presentingViewController:callback:]: unrecognized selector sent to class 0x10d9370b0'
    terminating due to uncaught exception of type NSException
    CoreSimulator 1048 - Device: iPhone 15 Pro Max (4E2318C4-8258-4F78-A679-52CE4D6F3CE4) - Runtime: iOS 17.2 (21C62) - DeviceType: iPhone 15 Pro Max
    • 1
    • 1
  • v

    Vinay

    10/27/2025, 6:38 PM
    Hi team, If you have any design documents related to integrating an app into Kotlin Multiplatform, could you please share them? I’d like to refer to a design document that outlines the different approaches for integrating an existing app built separately for Android and iOS into Kotlin Multiplatform with different builds
  • j

    Justin Tullgren

    10/27/2025, 7:12 PM
    Interesting development from the Swift Community: https://www.swift.org/blog/nightly-swift-sdk-for-android/ Does anyone have insights into Jetbrains thoughts on this? (Very new so just curious)
    j
    p
    j
    • 4
    • 8
  • s

    Smoothie

    10/27/2025, 8:39 PM
    I'm trying to cinterop a static .framework to use it from Kotlin. Everything work well but when I build the composeApp, it get linking issue
    Copy code
    Undefined symbol: _OBJC_CLASS_$__TtC19TestStaticFramework19TestStaticFramework
    But it shouldn't happen as it is a static library, I expect symboles to be included in the .framework generated by composeApp task. ######################### # DEF FILE #########################
    Copy code
    proprieties
    language = Objective-C
    modules = TestStaticFramework
    package = swift.tsf
    ######################### # GRADLE IOS CONF #########################
    Copy code
    kotlin
    listOf(iosArm64(), iosSimulatorArm64()).forEach { iosTarget ->
    
        iosTarget.binaries.framework {
            baseName = "ComposeApp"
            isStatic = true
        }
    
        val baseDir = "${rootDir.absolutePath}/TestStaticFramework/build/TestStaticFramework.xcframework"
        val frameworkDir = when (iosTarget.konanTarget) {
            KonanTarget.IOS_SIMULATOR_ARM64 -> "$baseDir/ios-arm64_x86_64-simulator"
            KonanTarget.IOS_ARM64 -> "$baseDir/ios-arm64"
            else -> error("Unsupported target: ${iosTarget.konanTarget}")
        }
        val frameworkPath = "$frameworkDir/TestStaticFramework.framework"
    
        val main by iosTarget.compilations.getting
        main.cinterops.create("TestStaticFramework") {
            defFile("${rootDir.absolutePath}/TestStaticFramework/TestStaticFramework.def")
            compilerOpts(
                "-F$frameworkDir",
                "-fmodules"
            )
        }
    
        iosTarget.binaries.all {
            linkerOpts(
                "-F$frameworkPath",
                "-framework",
                "TestStaticFramework"
            )
        }
    }
    ######################### # Static Lib Symbole ######################### nm -gU TestStaticFramework #########################
    Copy code
    TestStaticFramework_vers.o:
    0000000000000040 S _TestStaticFrameworkVersionNumber
    0000000000000000 S _TestStaticFrameworkVersionString
    
    TestStaticFramework.o:
    0000000000000000 T _$s19TestStaticFrameworkAAC5helloSSyF
    0000000000000140 T _$s19TestStaticFrameworkAAC5helloSSyFTj
    000000000000021c S _$s19TestStaticFrameworkAAC5helloSSyFTq
    0000000000000058 T _$s19TestStaticFrameworkAACABycfC
    0000000000000078 T _$s19TestStaticFrameworkAACABycfc
    00000000000000a8 T _$s19TestStaticFrameworkAACMa
    00000000000001e8 S _$s19TestStaticFrameworkAACMn
    00000000000001c8 S _$s19TestStaticFrameworkAACMo
    0000000000000134 T _$s19TestStaticFrameworkAACMu
    0000000000000388 S _$s19TestStaticFrameworkAACN
    0000000000000104 T _$s19TestStaticFrameworkAACfD
    00000000000001dc S _$s19TestStaticFrameworkMXM
    0000000000000388 S _OBJC_CLASS_$__TtC19TestStaticFramework19TestStaticFramework
    00000000000003e0 D _OBJC_METACLASS_$__TtC19TestStaticFramework19TestStaticFramework
    00000000000001d8 S ___swift_reflection_version
    0000000000000280 S __swift_FORCE_LOAD_$_swiftCompatibility56_$_TestStaticFramework
    0000000000000268 S __swift_FORCE_LOAD_$_swiftCoreFoundation_$_TestStaticFramework
    0000000000000270 S __swift_FORCE_LOAD_$_swiftDispatch_$_TestStaticFramework
    0000000000000250 S __swift_FORCE_LOAD_$_swiftFoundation_$_TestStaticFramework
    0000000000000260 S __swift_FORCE_LOAD_$_swiftObjectiveC_$_TestStaticFramework
    0000000000000278 S __swift_FORCE_LOAD_$_swiftXPC_$_TestStaticFramework
    0000000000000258 S __swift_FORCE_LOAD_$_swift_Builtin_float_$_TestStaticFramework
    0000000000000224 S _symbolic So8NSObjectC
    0000000000000232 S _symbolic _____ 19TestStaticFrameworkAAC
    🧵 3
    t
    t
    • 3
    • 6
  • s

    Skash

    10/28/2025, 8:56 AM
    Hey, is it possible to support the
    tabBarMinimizeBehavior
    from iOS 26 when having a SwiftUI TabView with a compose powered content view as tabbar item?
  • j

    Jeremie D

    10/28/2025, 12:30 PM
    not exactly a multiplatform question, but maybe someone here can help me; a few weeks ago I said I would start the migration process to remove the java dependencies to my project to eventually migrate to KMP. Im currently replacing retrofit for ktor. we were using java zonedDateTime and Im trying to migrate to kotlin.time.instant , but chat gpt has been making me run around in cirlces. I can't get the serializer to work for my instant. Ive tried update agp, kotlin, etc but it doesnt seem to work. any insights here? at first it complained that I had to mark it as experimental but once i did that
    Serializer has not been found for type 'Instant'. To use context serializer as fallback, explicitly annotate type or property with @Contextual
    , trying to make sure i don't go down an endless rabbit hole if anyone is using instant and ktor and standard serializable stuff could you share with me your configurations/plugins versions?
    z
    • 2
    • 8
  • s

    shikhar

    10/28/2025, 12:33 PM
    We noticed a crash in iOS coming from apple QoS related changes in atomicfu 0.28.0 If a contributor can have a look at it and check on the issue
    Crashed: com.apple.root.default-qos
    EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000016d98f100
    0  libsystem_pthread.dylib        0x7690 pthread_get_qos_class_np + 918
    com.apple.root.default-qos
    0  libsystem_kernel.dylib         0x65d4 __psynch_cvwait + 8
    1  libsystem_pthread.dylib        0x2b58 _pthread_cond_wait + 984
    2  calendar                       0xfda40 kfun:kotlinx.atomicfu.locks.SynchronizedObject.waitForUnlockAndLock#internal + 72 (NativeMutexNode.kt:72)
    Link: https://github.com/Kotlin/kotlinx-atomicfu/issues/563 Posting it here since there isn’t a dedicated channel for atomicfu
  • s

    shikhar

    10/28/2025, 12:35 PM
    @Vsevolod Tolstopyatov [JB] tagging, as saw you as a reviewer of #499
  • l

    loke

    10/28/2025, 3:51 PM
    I have a dilemma. A programming challenge if you will. I'm starting to think what I'm trying to achieve is not actually possible. In a nutshell: I'm developing a programming language interpreter in Kotlin. The technical details are not that interesting other than the fact that it has first-class symbols, similar to Lisp. Symbols live in a symbol table, which is just a hashmap, keyed on a string (the name of the symbol) and the value (the symbol object itself). This is quite simple, but... If there are no more references to the symbol object, they are no longer useful. I can of course make the hashmap reference the underlying symbol using a
    WeakReference
    . However, once the reference is cleared, I need to remove the key from the hashmap. In the Java backend, I can do this by leveraging
    ReferenceQueue
    and check when a reference has been dropped, and then remove the corresponding key (tracked in a separate hashmap). But, I struggle to figure out a way to achieve this using the JS and Native backends. To be honest, I'm not sure these backends have the necessary infrastructure to make this possible. There certainly doesn't seem to be anything similar to
    ReferenceQueue
    . Using
    Cleaner
    is unfortunately not sufficient, since I can't change the code so that it works with wrapper objects. The thing that is returned from the namespace object has to be of type
    Symbol
    , not
    SymbolWrapper
    which includes a
    Cleaner
    .
    s
    c
    • 3
    • 22
  • d

    Deniz Tumer

    10/28/2025, 10:04 PM
    Hey all! Does anyone know if there's a workaround for the deprecation of cocoapods trunk? I saw this Kotlin ticket, but it doesn't look like there's been any work to prioritize enabling non-cocoapods third party dependencies in apps: https://youtrack.jetbrains.com/issue/KT-53877 I'm going to be honest. Our product is in deep sh#$ if there's no solution for this. The only possible solution I have right now is to download XCframework binary files directly and import them into our code so they can be referenced as local libraries rather than 3rd party dependencies, but that's honestly months of work for our team and it just seems like a temporary workaround until this is actually enabled.
    d
    r
    t
    • 4
    • 3
  • y

    Yaroslav Shuliak

    10/29/2025, 3:54 AM
    Hello, I have a question. I want to create a composable with 2d animation implemented using spine2d for compose wasm. Spine2d offers many libraries for integration, there is WebGL library, is there any interop option that will keep correct sizing and draw order according to my composable hierarchy? I saw there is
    WebElementView
    composable that works using iframes so it will probably have issues with z-order
  • d

    Dumitru Preguza

    10/29/2025, 7:25 PM
    I have a problem with the "Run IOS on local device" functionality from IDEA, it builds my KMP&CMP project (ios target) fine, but after - the app updates/refreshes but does not run on my physical iPhone, from XCode it runs fine though When I run my app on an emulator from IDEA it works fine again, just the 'physical device run' does not work, no error message is shown, just silence
    t
    • 2
    • 1
  • s

    Suresh Maidaragi

    10/30/2025, 8:06 AM
    Hi we are seeing while generating the framework for multi modular kmp project, android studio taking around ~3 to 4hrs!!, project just contains 4 modules under single umbrella, from umbrella module we are generating the framework. Is there way to optimise or is it expected ?
    t
    • 2
    • 6
  • d

    dylan

    10/30/2025, 10:34 AM
    Is there any other way then
    compose multiplatform ressources
    when you want to load/read a json file on all platforms? We have a mock server we use for offline testing/development and we currently add json as strings in a kotlin file but would be nice if we can change this to loading a specific json file when the mock server needs to respond instead of using the string
    val
    .
    t
    j
    • 3
    • 3
  • p

    Pat Teruel

    10/30/2025, 2:24 PM
    Hello. Is there a way in Android Studio (or is it the KMP gradle project?) to disable discovery of Xcode files? Basically I have a project structured in a way that it includes multiple Xcode projects under subdirectories of the KMP project, but in Android Studio, this gets discovered by the compiler and I always get
    Generating Xcode files
    . I wish I could tell my project to not discover them. Hopefuly someone knows.
    t
    p
    • 3
    • 3
  • f

    filipebaptista

    10/30/2025, 5:31 PM
    Hello 👋 I have a kmp project that is sharing code between an iosapp and android app. I want to have some kind of segregation of the code in kmp and in the apps (android and ios), so that for example for QA builds can I have some experimental code but for production that code wouldn't be included. Any suggestion or approach that my work? Thanks
    f
    • 2
    • 6
  • e

    esdrasdl

    10/30/2025, 8:22 PM
    Hello. I found a bug when I setup a kmp module with CMP using the new android library multiplatform plugin. The error is:
    Copy code
    Unable to find method ''void com.android.build.api.variant.KotlinMultiplatformAndroidComponentsExtension.onVariant(kotlin.jvm.functions.Function1)''
    'void com.android.build.api.variant.KotlinMultiplatformAndroidComponentsExtension.onVariant(kotlin.jvm.functions.Function1)'
    I've setup a sample at Github: https://github.com/esdrasdl/android-cmp-bug I'm not sure if it a bug in Compose Multiplatform or AGP, but I wanted to share this sample to help investigate the issue.
    t
    • 2
    • 1
  • e

    ebtokyo

    10/30/2025, 9:14 PM
    Hello, is there a way to run Android Lint in a multiproject module that uses
    com.android.library
    plugin? I want to lint compose code in
    commonMain
    and
    androidMain
    . I couldn't find a way yet but I know it should be possible because circuit project do it. Looks like via spotless... 🤔
    e
    • 2
    • 1
  • m

    Moref

    10/30/2025, 9:55 PM
    Hey there, is there any example of testing a common view model in compose multiplatform also mocking the dependencies ?
  • y

    youssef hachicha

    10/31/2025, 9:30 AM
    I’m seeing a test isolation issue in my Kotlin Multiplatform project with iOS targets. Tests pass when run individually but fail when run as part of the full suite, has anyone faced this before? more info in 🧵
    • 1
    • 1
  • s

    S.

    10/31/2025, 11:22 AM
    Does anyone know of a kmp library to create pdf files from text input (markdown, html)? All I can find are libraries rendering compose UI to pdfs
  • n

    Nathan Fallet

    10/31/2025, 11:59 AM
    Is there any kotlin low level process library supporting all native platforms? (Same way ktor network supports low level sockets (not websockets) for all platforms). Asking to know if I should implement an expect/actual to spawn a process for each platform or use any existing official Kotlin Process library.
    • 1
    • 1