1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SPM→Swiftlintでめちゃくちゃ「The package product '〇〇' requires minimum platform version XX.X for the iOS platform, but this target supports YY.Y」って言われた

Posted at

環境

  • MacOS Sonoma 14.3
  • Xcode Version 15.2
  • SPM経由でSwiftlintを導入

今回遭遇したこと

スクリーンショット 2024-01-30 19.53.57.png
図のようにThe package product '〇〇' requires minimum platform version XX.X for the iOS platform, but this target supports YY.Yというエラーがめちゃくちゃ出てきました。

スクリーンショット 2024-01-30 17.57.54.png
minimum Deploymentsは15.0以上に設定しているのに何故?

回避策

以下2つ紹介。

  • Target -> FrameWorks, Libraries, and Embedded ContentSwiftlintFrameWorksがあるはずなので削除する

スクリーンショット 2024-01-30 22.26.13.png

  • 導入時SPM(Swift Package Manager)で導入するときSwiftlintFrameWorksをNoneのままにする!

まとめ

SwiftlintFrameWorksが悪さをしていると考えられます。
import Swiftlintのような使い方をするときにこのSwiftlintFrameWorksが必要そうです。Swiftlintはimportして使うことは基本的にありませんので、チェックを入れなくてもいいわけです。
では何故、Swiftlintにこのチェックがあるのかですが、おそらく「便宜的にライブラリ配布なら作らなきゃいけない」という可能性があります。また、こちらのように、Swiftlint自体のプログラムに対して処理を記述する際のために用意されているものである可能性があります。
用途に合わせて、このエラーが出たらSwiftlintFrameWorksを疑ってみてください。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?