https://kotlinlang.org logo
Join Slack
Powered by
# ios
  • m

    Mario

    07/08/2025, 8:09 AM
    Hi all - I think it's impossible to use
    AVCaptureVideoDataOutputSampleBufferDelegateProtocol
    because both its method definitions are the same, just with different names:
    Copy code
    public expect interface AVCaptureVideoDataOutputSampleBufferDelegateProtocol : platform.darwin.NSObjectProtocol {
        @kotlin.commonizer.ObjCCallable @kotlinx.cinterop.ObjCMethod public open expect fun captureOutput(output: platform.AVFoundation.AVCaptureOutput, didOutputSampleBuffer: kotlinx.cinterop.CPointer<cnames.structs.opaqueCMSampleBuffer>? /* from: platform.CoreMedia.CMSampleBufferRef? */, fromConnection: platform.AVFoundation.AVCaptureConnection): kotlin.Unit { /* compiled code */ }
    
        @kotlin.commonizer.ObjCCallable @kotlinx.cinterop.ObjCMethod public open expect fun captureOutput(output: platform.AVFoundation.AVCaptureOutput, didDropSampleBuffer: kotlinx.cinterop.CPointer<cnames.structs.opaqueCMSampleBuffer>? /* from: platform.CoreMedia.CMSampleBufferRef? */, fromConnection: platform.AVFoundation.AVCaptureConnection): kotlin.Unit { /* compiled code */ }
    }
    When I try to implement it, I get the following error:
    Copy code
    object : NSObject(), AVCaptureVideoDataOutputSampleBufferDelegateProtocol {
            override fun captureOutput(
                output: AVCaptureOutput,
                didOutputSampleBuffer: CMSampleBufferRef?,
                fromConnection: AVCaptureConnection
            ) {
                super.captureOutput(output, didOutputSampleBuffer, fromConnection)
            }
        }
    Copy code
    The corresponding parameter in the supertype 'AVCaptureVideoDataOutputSampleBufferDelegateProtocol' is named 'didDropSampleBuffer'. This may cause problems when calling this function with named arguments.
    d
    • 2
    • 2
  • a

    Anmol Verma

    07/17/2025, 5:21 PM
    https://kotlinlang.slack.com/archives/C3PQML5NU/p1752770413738959 Hi Folks, need some help with this error
  • g

    GNKumar

    07/22/2025, 4:11 AM
    Hi, Devs Does anyone have any idea , how to unzip the file using Swift without using any CocoaPods?
    a
    • 2
    • 2
  • k

    Kashismails

    07/29/2025, 8:52 AM
    🧵HAs anyone updated to macOs 26? getting this when building with xcode 26
    j
    • 2
    • 9
  • x

    xxfast

    08/06/2025, 1:19 AM
    Has anyone seen this error before? Not sure why im started seeing this all the sudden - all i did was to restart xcode
    Copy code
    Execution failed for task ':connect:compileKotlinIosArm64'.
    > Error while evaluating property 'kotlinNativeProvider$kotlin_gradle_plugin_common.kotlinNativeBundleVersion$kotlin_gradle_plugin_common' of task ':connect:compileKotlinIosArm64'.
    Showing All Messages
       > java.nio.file.FileAlreadyExistsException: /Users/User/.konan/kotlin-native-prebuilt-macos-x86_64-2.2.0/tools/konan_lldb.py
    r
    • 2
    • 3
  • f

    Fernando

    08/11/2025, 6:18 PM
    Hi! Quick question: I want to move my
    iosApp
    into an
    apps
    directory. I was able to move everything else but the iOS project, for some reason, it won't work. I've tried moving it with the Terminal, but it will not allow me to run the iOS project from the IDE (trough the Kotlin Multiplatform Project) Does anybody knows how can I move it while being able to run it from the IDE?
    p
    p
    • 3
    • 4
  • e

    Excellence kawej

    08/13/2025, 10:48 AM
    Hi everyone...
  • e

    Excellence kawej

    08/13/2025, 10:55 AM
    I'm getting this error while trying to implement Google authentication with Firebase:
    /Users/ctrltech/StudioProjects/Tmaterials/iosApp/iosApp/FirebaseBridge.swift:37:69 Trailing closure passed to parameter of type 'String' that does not accept a closure
    Here is my implementation:
    Copy code
    import Foundation
    import FirebaseCore
    import Firebase
    import FirebaseAuth
    import GoogleSignInSwift
    import GoogleSignIn
    
    @objc class FirebaseBridge: NSObject {
        @objc static func configureFirebase() {
            if <http://FirebaseApp.app|FirebaseApp.app>() == nil {
                FirebaseApp.configure()
            }
        }
    
        @objc static func isUserSignedIn() -> Bool {
            return Auth.auth().currentUser != nil
        }
    
        @objc static func signOut() {
            try? Auth.auth().signOut()
        }
    
        @objc static func signInWithGoogle(presenting: UIViewController, completion: @escaping (FirebaseUserWrapper?, Error?) -> Void) {
            guard let clientID = <http://FirebaseApp.app|FirebaseApp.app>()?.options.clientID else {
                completion(nil, NSError(domain: "NoClientID", code: 0))
                return
            }
    
            let config = GIDConfiguration(clientID: clientID)
            GIDSignIn.sharedInstance.signIn(withPresenting: presenting) { result in //error happens here
                switch result {
                case .success(let signInResult):
                    let user = result.user
                    guard let idToken = user.idToken?.tokenString else {
                        completion(nil, NSError(domain: "MissingIdToken", code: 1))
                        return
                    }
                    let accessToken = user.accessToken.tokenString
    
                    guard let idToken = idToken else {
                        completion(nil, NSError(domain: "MissingIdToken", code: 1))
                        return
                    }
    
                    let credential = GoogleAuthProvider.credential(withIDToken: idToken, accessToken: accessToken)
    
                    Auth.auth().signIn(with: credential) { authResult, error in
                        if let error = error {
                            completion(nil, NSError(domain: error.localizedDescription, code: 1))
                        } else if let firebaseUser = authResult?.user {
                            completion(FirebaseUserWrapper(user: firebaseUser), nil)
                        } else {
                            completion(authResult?.user.uid, nil)
                        }
                    }
                case .failure(let error):
                    if let error = error {
                        completion(nil, error)
                        return
                    }
    
                    guard let result = result else {
                        completion(nil, NSError(domain: "GoogleSignInError", code: 1))
                        return
                    }
                }
            }
        }
    }
    
    @objc class FirebaseUserWrapper: NSObject {
        let uid: String
        let email: String?
        let displayName: String?
        
        init(user: User) {
            self.uid = user.uid
            self.email = user.email
            self.displayName = user.displayName
        }
    }
    a
    • 2
    • 2
  • m

    Mirzamehdi

    08/28/2025, 5:38 PM
    https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/750#issuecomment-3197274509 is iosX64 deprecated already?
    a
    r
    a
    • 4
    • 12
  • m

    Mirzamehdi

    08/31/2025, 3:46 PM
    Why it is like when I want to change something in iosMain target, Android Studio starts to freeze, I guess it is not only me 😄. And this happens especially when something needs to be imported and it is missing. Any way to improve this ?
    c
    • 2
    • 1
  • v

    Vadim Briliantov

    09/01/2025, 11:03 AM
    Koog 0.4.0 is out! It comes with the
    iOS
    support now! The most advanced JVM framework for building AI agents is now also the first AI framework in the world that brings full-scale agentic flows to backend, browser, WebAssembly, Android — and iOS 🔥
    🍎 4
  • a

    Alexis

    09/02/2025, 12:54 PM
    Hello, Has anyone successfully use a kmp module within a swift local package? I've followed the instructions in the documentation here: https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-spm-local-integration.html But I get the following error when compiling from XCode:
    Exited with status code 127
    , and when looking at the report's details, I see this:
    /var/folders/ms/rzc7s4cj287gp9gvj1cs_ng00000gn/T/SchemeScriptAction-bjyy1r.sh: line 3: ./gradlew: No such file or directory
    . My folder structure is the following: • my_app_kmp ◦ shared (kmp modules) ◦ umbrella (umbrella module for ios) ◦ androidApp ◦ iosApp ▪︎ App ▪︎ Packages • feature_package Here's the script I've put in Edit Scheme > Build > Pre-Actions > New Run Script Action
    *cd* ..
    ./gradlew :umbrella:embedAndSignAppleFrameworkForXcode
    My umbrella's module build.gradle.kts contains this:
    Copy code
    kotlin {
        ...
        val xcfName = "Shared"
        listOf(
            iosX64(),
            iosArm64(),
            iosSimulatorArm64()
        ).forEach { target ->
            target.binaries.framework {
                export(projects.shared.data)
                export(projects.shared.di)
                export(projects.shared.domain)
                export(projects.shared.presentation)
                baseName = xcfName
                isStatic = true
            }
        }
        ...
    }
    And when trying to build from Android Studio I simply get this error:
    Build failed with 0 errors and 1 warning in 196 ms
    Anyone has an idea what I might be missing? EDIT: Looks like
    $SRCROOT
    is not available in pre actions, so I had to use something like that:
    *cd* "$(dirname "$PROJECT_FILE_PATH")/.."
    ✅ 2
  • d

    darkmoon_uk

    09/09/2025, 7:38 AM
    ⁉️ What happened to resolution of Kotlin/iOS symbols in IntelliJ in recent versions - performance fell off a cliff, the IDE's practically hanging when editing iOS source-set 😬 Same for others?
    f
    • 2
    • 1
  • e

    Edgars Malahovskis

    09/17/2025, 6:54 AM
    Anyone succeeded running kmp with latest xcode/toolchain tools and macos 26? I am running into issues for cinterop. Error log in 🧵
    f
    • 2
    • 7
  • t

    Thierry Kh

    09/18/2025, 1:47 PM
    Hello. Anyone for whom the following code doesn't work on iOS 18? It only opens "Apps" settings and not the actual app settings. It works well on iOS 15.
    Copy code
    val settingsUrl = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
    settingsUrl?.let {
        UIApplication.sharedApplication.openURL(it, emptyMap<Any?, Any?>(), null)
    }
    m
    m
    • 3
    • 6
  • m

    MarkRS

    09/19/2025, 2:24 PM
    Storekit2 Looking in the prebuilt native libraries (for 2.2.20) it looks (to my not very experienced eye) that the library only contains StoreKit1 definitions, they're SK<Name> structures rather than just <Name>, for example there's no "Product" structure, only "SKProduct". Presumably this explains why I can't import platform.storekit.Product into the isoMain folder of my shared module. Have I just misunderstood? Where are the storekit2 definitions?
    a
    • 2
    • 3
  • p

    Pearce Keesling

    09/19/2025, 3:13 PM
    Have we gotten any word or roadmap on when xcode 26 is supposed to be officially supported?
    j
    f
    • 3
    • 10
  • c

    Colton Idle

    09/26/2025, 3:33 PM
    I updated a few things from my cmp app from a few weeks ago. namely i updated from compose multiplatform 1.8.1 to 1.9.0 and from kotlin 2.1.21 to 2.2.20 and now I get this issue when trying to build in xcode. i also updated things like AGP and gradle version. i now get this error.
    a
    • 2
    • 14
  • t

    Thierry Kh

    09/26/2025, 5:25 PM
    I've recently published a CMP app on the App Store. I don't have a recent iOS device. On my iphone 6s, navigation and animations can be choppy, which is to be expected on such an old device. It's not super smooth on simulators but it's correct, totally acceptable. I've had feedback that my app can be slow at times on an iphone 13. In comparison it's super smooth on my pixel 8a. My question is, as of today, are performances poorer on iOS devices compared to Android ones when it comes to CMP? It wouldn't surprise me, but is it a fact? I feel like there isn't much that I can do to improve performances.
    c
    a
    +2
    • 5
    • 30
  • x

    xxfast

    09/29/2025, 1:23 AM
    Hi all. Has anyone encountered this issue? For context im serving a KMP module over SPM to a different xcode project, and seems like there's a version conflict somewhere 🤔
    Copy code
    Failed to build module; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.1 effective-5.10 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)', while this compiler is 'Apple Swift version 6.1.2 effective-5.10 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)'). Please select a toolchain which matches the SDK.
  • m

    Mateus Bauer

    10/02/2025, 1:03 AM
    Android CMP "EXCEPTION: DIDN'T FIND CLASSNAME FOR 'ISA' KEY" The project ‘iosApp’ is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts. Path: /Users/myuser/Documents/myproject/iosApp/iosApp.xcodeproj Exception: didn't find classname for 'isa' key Has anyone experienced this? My friend can build it just fine, he even zipped his project and I'm jealous, but I can't open the project in my xcode.
    a
    • 2
    • 3
  • f

    Fernando

    10/08/2025, 9:19 AM
    Hello everyone, I have a question about how does the Kotlin, in the iOS sourceset, generates or gets access to the
    platform
    package, and how does it gets autogenerated? 🤔 I wanted to do some experiments to use the new FoundationModels directly from Kotlin, but I don't seem to have access to that package. Does it auto generate, do I need to wait for a new kotlin release that comes with that interop? I'm using kotlin 2.3.0-Beta1 (just for test)
    f
    y
    • 3
    • 9
  • a

    Alex Styl

    10/13/2025, 12:47 PM
    I would like to access new APIs added in ios 26. how do i specify the version in my kotlin ios target? PS: the APIs I want to access is from Uikit
    f
    p
    • 3
    • 7
  • c

    Colton Idle

    10/15/2025, 2:45 PM
    How the bump to latest macOS, xcode, ios, etc? any issues or can i update all of those to use with kmp? mostly xcode is the one to worry about i suppose
    f
    • 2
    • 3
  • g

    Grigory Panko

    10/21/2025, 4:30 PM
    Hi guys! I'm trying to port our emoji detection logic from Swift to KMP (in iosMain sourceSet). The current implementation uses
    UnicodeScalarView
    type, which I can't figure out how to use in Kotlin. Perhaps this type simply doesn't exist in the native Kotlin/iOS API, or am I doing something wrong? The code I'm trying to port is in 🧵
    f
    • 2
    • 6
  • a

    and-out

    10/24/2025, 1:45 PM
    Hey everyone, This week I ran into a problem with my KMP (Android/iOS) app. When I include a `JWT library`(https://github.com/Appstractive/jwt-kt), and then inspect the shared Xcode framework using
    vtool
    , I get the following output:
    Copy code
    vtool -show-build shared/build/xcode-frameworks/Debug/iphoneos18.5/shared.framework/shared
    Load command 10
          cmd LC_BUILD_VERSION
      cmdsize 40
     platform IOS
        minos 14.0
          sdk 14.0
       ntools 2
         tool LD
      version 954.16
         tool LD
      version 955.13
    → As you can see, both
    minos
    and
    sdk
    are set to
    14.0
    . However, in the corresponding
    Info.plist
    , the
    MinimumOSVersion
    is
    13.0
    . This mismatch between the framework and the Info.plist causes Apple to reject the build with the following error:
    Copy code
    90208: Invalid Bundle. The bundle <http://iosApp.app/Frameworks/shared.framework|iosApp.app/Frameworks/shared.framework> does not support the minimum OS Version specified in the Info.plist.
    Without including the JWT library, I get this instead:
    Copy code
    vtool -show-build shared/build/xcode-frameworks/Debug/iphoneos18.5/shared.framework/shared
    Load command 9
          cmd LC_BUILD_VERSION
      cmdsize 40
     platform IOS
        minos 13.0
          sdk 18.0
       ntools 2
         tool LD
      version 954.16
         tool LD
      version 955.13
    → Here,
    minos
    is
    13.0
    , matching the
    Info.plist
    , and the build is accepted by Apple. My questions are - Why is the
    minos
    value out of sync with the
    Info.plist
    ? - Who (or what) determines which
    minos
    and
    sdk
    are used when building the framework? I also read the info.plist customizing section in the [documentation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-build-native-binaries.html#customize-the-info-plist-file) and my question here is, why i cant override the
    MinimumOSVersion
    there? On a sidenote, when i try to override the info.plist MinimumOSVersion with
    freeCompilerArgs += listOf("-Xoverride-konan-properties=osVersionMin.ios_simulator_arm64=15.6;osVersionMin.ios_arm64=15.6;osVersionMin.ios_x64=15.6")
    I run into linker issues with
    CrashKiOS
    (https://github.com/touchlab/CrashKiOS). Without
    CrashKiOS
    , the
    info.plist
    is updated as expected. But the shared.framework is nevertheless build with
    minos
    14
    and
    sdk
    14
    . I use kotlin 2.2.10, my gradle looks like this
    Copy code
    kotlin {
        jvmToolchain(BuildConstants.JAVA_VERSION)
    
        androidLibrary {
            namespace = "${BuildConstants.APP_NAMESPACE}.shared"
            compileSdk = BuildConstants.SDK_COMPILE_VERSION
            minSdk = BuildConstants.SDK_MIN_VERSION
        }
    
        listOf(
            iosX64(),
            iosArm64(),
            iosSimulatorArm64(),
        ).forEach { iosTarget ->
            iosTarget.binaries.framework {
                baseName = "shared"
    
                // for each exported library, add an `api` dependency in commonMain
                export(projects.sharedLibs.core)
                export(projects.sharedLibs.domain)
                export(projects.sharedLibs.data)
                export(projects.sharedLibs.resources)
    
                linkerOpts("-ld_classic", "-lsqlite3")
            }
        }
    
        sourceSets {
            commonMain.dependencies {
                // see ios framework export above
                api(projects.sharedLibs.core)
                api(projects.sharedLibs.data)
                api(projects.sharedLibs.domain)
                api(projects.sharedLibs.resources)
    
                implementation(kotlinLibs.skie)
                implementation(projects.sharedLibs.ui)
            }
        }
    }
    o
    • 2
    • 2
  • y

    Yu-Hsuan Lin

    10/26/2025, 11:10 PM
    https://www.zetetic.net/sqlcipher/sqlcipher-apple-community/#swift-package-manager-integration Any idea how to integrate SQLDelight with SPM version of SQLCipher? They stop updating cocoapods.
    f
    • 2
    • 1
  • r

    Rafael Costa

    10/28/2025, 10:47 AM
    Hey guys 👋 I have this transient exported module to my XCFramework that contains multiple interfaces with methods like
    subscribe(listener: SomeListenerType)
    . Apparently, when called from iOS, only one of these parameters gets to be called "listener", the others are adding
    _
    suffixes. I don't understand why having the same name would be an issue? Or if it isn't how can I keep "listener"? I tried ObjcName but it doesn't work, it still adds the underscore suffixes.
    d
    • 2
    • 11
  • g

    Gabriel Messias De Moura Ilha

    10/28/2025, 4:45 PM
    Hello everyone, I generated a framework using Cocoapods, the build.gradle block is below. My app supports iOS 14.1 and later, it's a native iOS app and is only using one feature in KMP, but when I open the app on an iPhone with iOS 15.0 to iOS 15.3, the app is crashing. The log message is:
    Copy code
    dyld[56606]: Symbol not found: __ZNSt3__117bad_function_callD1Ev
    Referenced from: /Users/silvatf1/Library/Developer/CoreSimulator/Devices/E3823A73-6312-44D2-BB5E-8423F234210E/data/Containers/Bundle/Application/873EB1C5-B653-46DF-B9EF-12487CD9203F/Digital-UAT.app/Frameworks/DigitalKMP.framework/DigitalKMP
    Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libc++.1.dylib
    From what I've researched, this error is caused by the C++ code generated, it's generating a symbol that doesn't exist in these older versions of iOS. Has anyone else had a similar problem?
    Copy code
    cocoapods {
            version = libVersion
            summary = "Some description for a Kotlin/Native module"
            homepage = "Link to a Kotlin/Native module homepage"
            ios.deploymentTarget = "14.1"
            name = frameworkName
    
            podfile = project.file("../iosApp/Podfile")
    
            publishDir = rootProject.file("./")
    
            framework {
                baseName = frameworkName
                homepage = repositoryUrl
                isStatic = false
    
                source = "{ :git => '${repositoryUrl}.git', :tag => spec.version.to_s }"
    
                binaryOptions["bundleId"] = bundleId
                binaryOptions["bundleVersion"] = libVersion
    
                freeCompilerArgs += listOf(
                    "-Xexport-kdoc",
                    "-Xexpect-actual-classes",
                    "-Xoverride-konan-properties=osVersionMin.ios_arm64=14.1",
                    "-Xoverride-konan-properties=osVersionMin.ios_x64=14.1",
                    "-Xoverride-konan-properties=osVersionMin.ios_simulator_arm64=14.1"
                )
    
                export(project(":networking-kmp"))
                export(project(":suitability-kmp"))
            }
        }
    f
    • 2
    • 3
  • e

    Ehab Al

    10/31/2025, 10:30 AM
    Hi everyone, Did anyone face the same issue before https://youtrack.jetbrains.com/issue/KMT-1843/iOS-UIKit-Objective-C-crash-when-creating-KMP-class-instances