Skip to content

Static linking conflict in iOS #153

@bpappin

Description

@bpappin

KMPNotifier and Kotlin version:
kmpnotifier version: 1.6.0, firebase 34.4.0, gitlive-firebase 2.3.0

Describe the bug
I am getting crashes due to static linking of duplicate libraries.
In this case its the google libraries that KMPNotifier imports.

I also noticed this in the output:

warning: Interop library /Users/<...>/.gradle/caches/modules-2/files-2.1/io.github.mirzemehdi/kmpnotifier-iossimulatorarm64/1.6.0/225eaedef466126870d3ba93ead9fd7f882e9843/kmpnotifier-iosSimulatorArm64Cinterop-FirebaseMessagingMain-1.6.0 can't be exported with -Xexport-library

In which platform bug occurs?
ios

To Reproduce
Import Firebase and KMPNotifier

Expected behavior
The app builds and runs

Additional info to help reproduce

This is the AI explanation of the problem:

The error message Class ... is implemented in both ... dylib and ... dylib where both paths point to the same dynamic library file is a classic sign of a static linking conflict.

Here’s what’s happening:

1. Your Kotlin Multiplatform module (composeApp) is being compiled into a framework.
2. It is being configured as a static framework. This means it bundles all of its dependencies (including the native GoogleSignIn library pulled in by one of your KMP dependencies) directly into its own binary.
3. When the final app is linked, another part of your project (likely another KMP dependency also being linked statically) also includes the GoogleSignIn library.
4. The linker sees two copies of PSMPrivateMembershipBlindersResponse inside the same final .dylib and throws the warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions