Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the static library built by spm, Xcode reports an error: Duplicate symbols #8008

Open
1 task done
tamwei opened this issue Sep 29, 2024 · 1 comment
Open
1 task done
Labels

Comments

@tamwei
Copy link

tamwei commented Sep 29, 2024

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

When a static library(framework) with a dependency was built in app, Xcode report an error: duplicate symbol

Expected behavior

The above swift static library can be used normally

Actual behavior

Xcode report an error: duplicate symbol

Steps to reproduce

Step:

  1. I created a static library(framework) with a dependency by spm.
  2. Then when I buld an app with the static library, Xcode reports an error: duplicate symbols

The following cases were tested:

  1. Using either the Alamofire dependency or the Firebase dependency alone in Xcode will result in compilation errors.
  2. No error will be reported when compiling the app under Objective-C, but an error will be reported when compiling the app under Swift.

Swift Package Manager version/commit hash

Swift Package Manager - Swift 5.9.0

Swift & OS version (output of swift --version ; uname -a)

1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx13.0

@tamwei tamwei added the bug label Sep 29, 2024
@dschaefer2
Copy link
Member

Xcode report an error: duplicate symbol

This contradicts the question above whether this was reproducible from the SwiftPM CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants