That pesky Xcode 13.2+ build error after pod install

Þorvaldur Rúnarsson
Swift2Go
Published in
2 min readMay 18, 2022

Recently Xcode command line tools had some breaking changes. So what they did was change the default values for some xcode project build settings.

Which build settings. Well now the default target platform is macOS. Probably sounded like a good idea at the time, after all, unless you buy a USB-C to Lighting cable the only real device you can run from xcode is the Mac.

But this of course breaks all projects that use cocoapods… and probably every other tool that generates xcproj or .xcworkspace.

TLDR; How to fix this?

If your build needs fixing after these changes you’re probably targeting mobile platforms.

If that’s the case you could override the default settings in your Podfile using a post_install ruby script:

NOTE: If you’re also targeting iPadOS supporting SUPPORTED_PLATFORMS would include ipados as well

If you’re having trouble building for the iOS Simulator on M1 chips

I think this is a related issue. Maybe some other build setting they changed. In this case you can try to include arm64 in your xcode project file’s “Excluded architectures”

Notes for Flutter & React Native Developers

If you are using either Flutter or React Native your Podfile might already have some post_install script that sets up tool specific build settings for your project.

Cocoapods only supports having one post_install script so be sure to also include those settings in yours.

Some Additional References

Don’t forget to clap 👏

If you like this content feel free to follow me on Medium for future posts and updates.

Happy hacking everyone!

--

--

Þorvaldur Rúnarsson
Swift2Go

Full Stack Developer (TypeScript, React, Python, Node.js, Swift, ReactNative, Flutter), also... dad, football enthusiast & guitar enthusiast.