I’d been having a problem where I was yo-yoing backwards and forwards between CocoaPods and Xcode, each presenting a warning which once remedied would cause the other to raise a warning.
The issue is around embedding Swift Libraries when working on a Swift based project. There are two settings, one deprecated
EMBEDDED_CONTENT_CONTAINS_SWIFT and one more current
CocoaPods generates the settings for Swift projects (possibly just those that have dependencies on Swift pods) on running
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
This setting tells Xcode to include the Swift libraries as part of the product even if the product itself is Objective-C rather than Swift.
From Xcode 8.0 the setting was changed to
This causes Xcode to warn the user to “Update to recommended settings”. Applying these changes results in the following Build Settings:
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
This causes CocoaPods to respond with the warning:
The target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting. This can lead to problems with the CocoaPods installation
The advice given in the warning is to:
- Use the
- Remove the build settings from the target.
Being a sucker for minimalism, I opted for the second option. This was the wrong move. The correct way of resolving this issue is to use the
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = $(inherited)
This can be found on the targets Build Settings page, under Build Options.
This has been fixed in Cocoapods 1.2.0, however, if like me you have a project from before then, you may need to clean out those settings in Xcode and potentially your Pods directory before running
pod install. With any luck this should also resolve the issue.