SwiftLint
SwiftLint copied to clipboard
SwiftLint 0.52.3/4: The package product ... requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0
New Issue Checklist
- [x] Updated SwiftLint to the latest version
- [x] I searched for existing GitHub issues
Describe the bug
So we added the SwiftLint plugin to the app project and also the SPM modules Package.swift
file. We then checked the project target version was iOS16.1 and specified that in the platforms
section of the Package.swift
file.
This all works well within Xcode.
However when we started building our CI scripts and running xcodebuild
the compilation fails with a stream of messages about the minimum OS target version being 11. For example:
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 11.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
And of course a whole bunch of compilation failures due to various APIs such as async/await not being available in iOS11.
I've tried running xcodebuild
from the command line like this:
xcodebuild -workspace Rhythm.xcworkspace -scheme Application -configuration Debug -sdk iphonesimulator16.4 -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' -skipPackagePluginValidation clean build
But no luck and no change.
I dumped out the SPM dependencies which look like this:
.
├── vexil<https://github.com/unsignedapps/[email protected]>
├── factory<https://github.com/hmlongco/[email protected]>
├── swift-markdown-ui<https://github.com/gonzalezreal/[email protected]>
├── swiftlint<https://github.com/realm/[email protected]>
│ ├── swift-argument-parser<https://github.com/apple/[email protected]>
│ ├── swift-syntax<https://github.com/apple/[email protected]>
│ ├── sourcekitten<https://github.com/jpsim/[email protected]>
│ │ ├── swift-argument-parser<https://github.com/apple/[email protected]>
│ │ ├── swxmlhash<https://github.com/drmohundro/[email protected]>
│ │ └── yams<https://github.com/jpsim/[email protected]>
│ ├── yams<https://github.com/jpsim/[email protected]>
│ ├── swiftytexttable<https://github.com/scottrhoyt/[email protected]>
│ ├── collectionconcurrencykit<https://github.com/JohnSundell/[email protected]>
│ └── cryptoswift<https://github.com/krzyzanowskim/[email protected]>
├── rive-ios<https://github.com/rive-app/[email protected]>
|...
Suspecting from the errors that the root problem was something SwiftLint depended on. I then removed SwiftLint and the command line builds started working.
Environment
- SwiftLint version: 0.52.3 & 0.52.4
- Installation method: SPM
- Are you using [nested configurations]: No
- Which Xcode version are you using: 14.3.1
+1
Confirmed on our Azure DevOps CI/CD as well
FYI my issue #5228 has been solved with the release of 0.53.0.
I close my own issue.........
Still reproducible for me with SwiftLint 0.53.0 and Xcode 15.0 when trying to execute test for a package with xcodebuild:
xcodebuild test -scheme MyPackageScheme -sdk iphonesimulator17.0 -destination "OS=17.0,name=iPhone 15 Pro"
I get almost the same output:
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
Once I remove SwiftLint from package dependencies, everything starts working, but I really want to run SwiftLint on CI for PR builds.
same for me, SwiftLint 0.53.0 and Xcode 14.3
So I am lucky. But I use Xcode 15.0.
@curia-damiano, just out of curiosity: did you have these errors while building an app or a standalone Swift package?
Yes, identical error messages, in fact I've opened issue #5228.
As said, even my issue was not closed (I have closed it myself), but I've seen and tested release 0.53.0, and under Xcode 15.0, it works fine to me.
FYI I reopen my issue because on a different project I get exactly the same error, even with 0.53.0
v0.53.0 hasn't fixed it over here. Only updated the error to say it requires support for iOS 12 instead of 11. So improved I guess, but definitely NOT fixed.
Please read the error messages that Xcode is providing carefully. Your projects are configured in such a way that Xcode is attempting to build SwiftLint for iOS, which will not compile. SwiftLint supports building and running on macOS and Linux only.
This appears to be a common mistake. Please try this suggestion to see if it helps: https://github.com/realm/SwiftLint/issues/3073#issuecomment-934301131
You probably only want to add the plugin to run swiftlint during builds for your app target but added the Swiftlint frameworks to your app target by mistake. Make sure to remove them from Framework and Libraries
.
I have the exact same issue with Azure, and I haven't added any SwiftLint products in the target. It's only added as a plugin during build phase, but still, I get the same error.
Seeing the same issue using Github Actions. We're not using the plugin with an app project and Swiftlint has not been added to the app target. We're only using the SPM plugin with some local packages. Tried with 0.54.0
and 0.53.0
on swift 5.9, iOS 15.
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintFramework' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintBuiltInRules' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintPlugin' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintCore' from project 'SwiftLint')
error: The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
error: The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0 (in target 'SwiftLintExtraRules' from project 'SwiftLint')
Testing failed:
The package product 'SwiftIDEUtils' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftOperators' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftParser' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftSyntax' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'SwiftSyntaxBuilder' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
The package product 'CollectionConcurrencyKit' requires minimum platform version 13.0 for the iOS platform, but this target supports 12.0
Testing cancelled because the build failed.
@jpsim It's looking like this issue is completely resolved for me on main. Do we know if there is any plan to cut another release for SPM so we can get the fix?
➕
You probably only want to add the plugin to run swiftlint during builds for your app target but added the Swiftlint frameworks to your app target by mistake. Make sure to remove them from
Framework and Libraries
.![]()
That's it, thank you!