Binary Swift Package targets don't support a `dependencies` argument, making it hard to manage dependencies for closed-source SDKs distributed as XCFrameworks. The workaround is to add a second, regular Swift Package target alongside the binary target, declare all dependencies there, and include both targets in the library product. This lets the binary target access dependencies at runtime. The post also covers the private source repo setup, Xcode project requirements, and a caveat: open-source dependencies get statically linked into the framework, potentially tripling its size.

8m read timeFrom danielsaidi.com
Post cover image
Table of contents
Update: 2025-06-23TL;DRBackgroundHow did this affect me?Why can’t binary packages have dependencies?The bad file sync approachFinding a workaroundAdding dependencies to the private packageAdding dependencies to the public packageThings to considerConclusion