This repo demonstrates an issue with Xcode linking against newer APIs (in this case, SwiftUI). Originally discovered in https://github.com/firebase/firebase-ios-sdk/issues/7785.
This package wants to offer a new API for those users who are using SwiftUI, but still providing
default functionality that is available for older iOS versions. All APIs are marked appropriately
Create a new iOS project in Xcode (12.5 is the latest as of this writing).
Click "File -> Swift Packages -> Add Package Dependency..."
Enter the URL of this repo (https://github.com/ryanwilson/Repro-SwiftPMMinVersionBuild). Use the default version.
Leave the default Package Product enabled and hit "Finish".
Change the build target to "Any iOS Device (arm64)".
Attempt to build.
A successful build, since no APIs are being used outside of their iOS version availability.
Swift compiler error with the following messages:
<LocalPath>/Sources/SwiftPMMinVersionIssue/ShinyAPI.swift:16:25: Cannot find type 'View' in scope <LocalPath>/Sources/SwiftPMMinVersionIssue/ShinyAPI.swift:13:25: Cannot find type 'View' in scope
Even if the targeted iOS version in the Xcode project is 14.0, it still fails to compile.
Changing the minimum supported iOS version in this repo to
.v11 resolves the issue. This can be
observed by switching the SwiftPM checkout to the branch named
We ran into a similar error when building for an API available on iOS 11+ - perhaps it's a 32 bit transition issue?
|Last commit: 2 days ago|