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
[SR-14786] Can't build a multi-platform Swift Package with a platform-specific dependency #4412
Comments
@swift-ci create |
Comment by Mike Achtelik (JIRA) Is there any workaround or plan to fix this? It's still a problem in Swift 5.5 which comes with Xcode 13.1. |
Also running into this issue several years later. Are there any workarounds or ongoing solutions? This breaks previews for vision and watchOS as well. It seems like this might be a dupe of #5866 Wherein this comment indicates that the issue is resolved for SPM but not in XCode. Can someone verify this? If so, it’s an old post from literally years ago, I’d like to verify that the issue is XCode dependent and that Apple has just sat on the issue for this long |
If you're seeing an issue with previews specifically, the problem is most likely different from this and specific to Xcode. |
Thanks for the fast reply - seems like previews will try to build for vision and watchOS even if the package doesn't support the platform (firebase analytics is a common one) and gives this error message. I'll respond to the open ticket I have with Apple asserting this is SPM lol. |
Environment
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55) that comes with Xcode 12.5 (12E262)
macOS Big Sur 11.4 (20F71)
Additional Detail from JIRA
md5: 7d1dd3f8d0e24cc9189b0198a0636522
Issue Description:
I have a Swift Package that supports multiple platforms (iOS and tvOS in my case).
The package contains a single library product, build from a target that depends on platform-specific dependency.
Despite adding a
condition
property to the platform-specific dependency, I can only build the library for the platform supported by the dependency.My
Package.swift
looks like this:Note that
FirebaseAnalytics
is used here as an example of a dependency that supports a single platform - in this case, it's iOS.The package builds correctly for iOS, but fails to build for tvOS with the following error:
It looks like
condition: .when(platforms: [.iOS])
is ignored for some reason.Here you can find an example project that reproduces the issue:
https://github.com/darrarski/spm-platform-specific-dependecy-demo
The text was updated successfully, but these errors were encountered: