Xcode を Xcode 27 にアップデートしたところmacOS向けにビルドができなくなった。SwiftUIで macOS / iOS 両対応してあるアプリで発生。
環境
- Xcode 27.0 Beta
- macOS 27.0 Beta
エラー内容
The macOS deployment target ‘MACOSX_DEPLOYMENT_TARGET’ is set to 11.0, but the range of supported deployment target versions is 12.0 to 27.0.x.
該当箇所は TARGET > Build Settings > macOS Deployment Target
これが macOS 27 Golden Gate になっているのを確認。
エラー内容的には MACOSX_DEPLOYMENT_TARGET が 11.0 に設定されているとのことだが。
調査
参考になりそうな記事を見つけた。
- macOS 27 Golden Gate May Become the End of the Golden Era for Mac Apps : r/macapps
- Xcode 27 May End the Golden Era for Backward-Compatible Apple Apps | Reverse Everything
原因
テストターゲット側の設定が macOS 11.5 に設定されていた。
これを Recommended に設定した。12以上であればok。
あわせてメインターゲットの方も Recommended に設定。
iOSも対応
続いてiOSの方もエラーが出たので対応。
The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 14.0, but the range of supported deployment target versions is 15.0 to 27.0.x.
15以上に設定する。今回は17以上に設定。
Testターゲットの方も忘れずに対応。