Skip to content

Linker plugin not working with the new Kotlin/Native artifacts DSL #46

Description

@joharei

The linker plugin is not applying the compiler args when using the new DSL for Kotlin/Native artifacts: https://kotlinlang.org/docs/multiplatform-native-artifacts.html.

I can work around it by specifying the compiler args manually:

kotlinArtifacts {
    Native.XCFramework("sdk") {
        targets(iosX64, iosArm64, iosSimulatorArm64)
        setModules(
            project(":shared"),
            project(":lib")
        )

        // Add this:
        kotlinOptions {
            freeCompilerArgs = listOf(
                "-linker-options",
                "-U _FIRCLSExceptionRecordNSException " +
                        "-U _OBJC_CLASS_\$_FIRStackFrame " +
                        "-U _OBJC_CLASS_\$_FIRExceptionModel " +
                        "-U _OBJC_CLASS_\$_FIRCrashlytics"
            )
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions