Search code examples
iosswiftcocoapodsxcode12xcode12.5

Target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting warning in Xcode 12.5 and Swift 5


[!] The `SampleUITests [Prod]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` 
build setting defined in `Pods/Target Support Files/Pods-Sample-SampleUITests/Pods-Sample-SampleUITests.prod.xcconfig'. 
This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

I am getting the above warning when i try to create a new xcode project and add cocoa pods into the project. I already tried the solutions mentioned in What's ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with CocoaPods, Swift 3 and Xcode 8 but nothing worked for me.


Solution

  • In some Xcode versions(in my case 12.2), when we create a new project with tests included, Xcode sets the "Always Embed Swift Standard Libraries" for tests and UITests to Yes and it would be shown in Bold text, which indicates its overridden

    To confirm this, check in your project's build settings and target's build settings if the "Always Embed Swift Standard Libraries" setting has been modified by Xcode. Typically it should appear like this in Normal text (not bold) meaning its not modified. Non modified build setting Certain versions of Xcode modifies this setting and hence it would appear in Bold text modified build setting

    To resolve this,

    1. Go to the project's Pbxproj file (open in VSCode or any editor)
    2. Search and remove all mentions of ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
    3. On doing so, the project would take default settings for ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES.

    Try pod install/pod update now and the build setting warning should no longer occur.