What's ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES with CocoaPods, Swift 3 and Xcode 8

42,414

Solution 1

Go here in your build settings...

enter image description here

And then highlight the "Always embed..." row and hit delete. This will change it to use the inherited property.

Even after you make this change it will remain there but it will probably change from bold to normal text. If that change happens then it is inherited.

Normal text = inherited.

Bold text = overridden.

Solution 2

I was able to fix this problem by doing the following (step by step):

  1. Go to Build Settings
  2. At the top select All and Combined
  3. Under Build Options you should see Always Embed Swift Standard Libraries and it is bold.
  4. Click on it and click delete (<-). It should now be unbolded. (Normal text = inherit)
  5. Pod install and the error/errors should go away!

enter image description here

Solution 3

  1. Go to Build Settings
  2. At the top select All and Combined
  3. Under Build Options search "Always Embed Swift Standard Libraries"
  4. Update its value with $(inherited)
  5. Now install pod and all the error should go.

enter image description here

Solution 4

The accepted solution works, but now you have to make sure all of your teammates are performing it each pod install.

And we all know they won't.

You could make CococaPods do it automatically, by adding this to the bottom of your Podfile:

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if config.name == 'MyPOD' 
                config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'Yes'
            end
        end
    end
end

More info here: https://www.devsbedevin.net/cocoapods-always-embed-swift-standard-libraries/

Solution 5

I suggest to set all pods after install as suggested in the message:

post_install do |installer_representation|
    installer_representation.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = '$(inherited)'
        end
    end
end
Share:
42,414
MEH
Author by

MEH

Updated on June 23, 2020

Comments

  • MEH
    MEH almost 4 years

    after installing cocoapods and adding pod "SwiftCarousel" to pod file and uncomment the platform :ios, '9.0' I got this ERROR

    ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

    and what should I do?

    mohammed.elias$ pod install
    
    Analyzing dependencies
    Downloading dependencies
    Installing SwiftCarousel (0.8.0)
    Generating Pods project
    Integrating client project
    
    [!] Please close any current Xcode sessions and use `scrollView.xcworkspace` for this project from now on.
    Sending stats
    Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
    
    [!] The `scrollViewTests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewTests/Pods-scrollViewTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
    
    [!] The `scrollViewTests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewTests/Pods-scrollViewTests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
    
    [!] The `scrollViewUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewUITests/Pods-scrollViewUITests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
    
    [!] The `scrollViewUITests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-scrollViewUITests/Pods-scrollViewUITests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    
  • MEH
    MEH over 7 years
    I hit delete and nothing changed. could you be more specific , please ? I'm very new to iOS devlopment.
  • Fogmeister
    Fogmeister over 7 years
    It will remain there but it will prob change from bold to normal text. If that change happens then it is inherited. Normal text = inherited. Bold text = overridden.
  • MEH
    MEH over 7 years
    Good , then should I do it for every project I'll make or there's a global configuration for Cocoapods ?
  • user28434'mstep
    user28434'mstep over 7 years
    @Fogmeister for better visualisation of inheritance he also can select Levels option. It's way more visual than checking boldness of a text.
  • Rob Norback
    Rob Norback over 6 years
    This was super helpful, it was silly hard to find that setting.
  • ArgaPK
    ArgaPK over 6 years
    Could you please tell me, are these errors or warnings? i am new , although the pods installed completely: "[!] The LearningTests [Debug] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in Pods/Target Support Files/Pods-LearningTests/Pods-LearningTests.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the $(inherited)` flag, or - Remove the build settings from the target." , is this a warning or error? is the pods install successfully?
  • Ryan Brodie
    Ryan Brodie almost 6 years
    @ArgaPK Yes exactly, follow their instructions and they'll go away
  • responser
    responser over 5 years
    Simple and effective!
  • Manesh
    Manesh over 5 years
    worked for me, for all those still getting errors, make sure to do this to the Targets OS and UITests also!
  • Zorayr
    Zorayr almost 4 years
    Can't delete on Xcode 11. Well, hitting on Delete just make it not bold, but doesn't actually delete the property.
  • Zorayr
    Zorayr over 3 years
    Been a while, but pretty sure I was just hitting on the Delete button.
  • ergunkocak
    ergunkocak over 2 years
    It worked for me at the time. Cocoapods evolved since then ;)
  • Thiago Silva
    Thiago Silva about 2 years
    2022 here and it still works. Thanks