Errors after updating to Xcode 8: "No such module" and "target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT`build setting"

IosSwiftXcodeCocoapodsXcode8

Ios Problem Overview


I'm getting No such module for Pods when I try to build the project. If I remove the code expecting this Pod, another 'No such module' comes up for another Pod, which means every Pod must be affected. When I type pod install I get the following messages:

[!] The X target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `X’. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

[!] The `X` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `X'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

I get each of these for both the debug and release versions of my app and the two tests, so 12 messages in total.

I have set Always Embed Swift Standard Libraries and EMBEDDED_CONTENT_CONTAINS_SWIFT to NO and YES both in my Build Settings and this did nothing. I also added the following code to my Podfile and it didn't work either:

post_install do |installer|
installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO'
    end
end
end

Ios Solutions


Solution 1 - Ios

[!] The `X` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `X'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

I had met this problem today. I solved it by

  1. Go to Project/Targets -> [Project Name] -> Build Settings.
  2. search "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"
  3. click the right of Debug, and selected 'Other', input "$(inherited)"
  4. do same with 'Release' and install your pod

You can follow the image below.


enter image description here

Solution 2 - Ios

The errors you see when running pod install should not cause the No such module errors. So my guess is that these errors are unrelated.


To get rid of the pod install errors:

This happens because you define a flag in your build settings which overrides that set by CocoaPods. It doesn't matter if you set it to YES or NO, it will still overwrite the setting from CocoaPods.

To fix this:

  1. Go to Project/Targets -> [Project Name] -> Build Settings.
  2. Find and click on the relevant setting (you can use the search box in the top right corner).
  3. Press Backspace to remove the setting.

You should see the setting going from bold to normal font. This means that the setting has been deleted, and is using a default value instead.

Repeat for each flag giving you an error, and rerun pod install to verify that it worked.


Reasons for No such module errors:

There are a number of way that this error can occur. Have you looked at these answers to see if any applies to your case? If you report back on that it will be easier to help you.

  1. Xcode : “No such module” error, but the framework is there
  2. “no such module” on Xcode 7 beta 2

Solution 3 - Ios

(Updated as of July 29, 2018)

  1. Projects/Targets --> Project Name --> Build Settings
  2. Build Options
  3. Click on Always Embed Swift Standard Libraries so that it is highlighted
  4. Press the delete button on your keyboard

The Always Embed Swift Standard Libraries should no longer be Bold, and you will no longer receive this warning when performing pod updates or pod installs =)

Solution 4 - Ios

This is what I worked for me:

pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData

Then I just clean my project and build it again.

Solution 5 - Ios

when I import SDWebImage in my project second time,It worn that Module FLAnimatedImage not found,and when I pod install ,it warn "... ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES ... - Use the $(inherited) flag, or - Remove the build settings from the target." At last, I find the way that remove the SD completely,specialy in the finder ,in the pods' products,and delete the project in the simulator , then import SD again.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionQuestionerView Question on Stackoverflow
Solution 1 - IosStarkView Answer on Stackoverflow
Solution 2 - IosaskielboeView Answer on Stackoverflow
Solution 3 - IosBennyTheNerdView Answer on Stackoverflow
Solution 4 - IospableirosView Answer on Stackoverflow
Solution 5 - IosJackXuView Answer on Stackoverflow