Errors after updating to Xcode 8: "No such module" and "target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT`build setting"
Solution 1
[!] 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
- Go to Project/Targets -> [Project Name] -> Build Settings.
- search "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES"
- click the right of Debug, and selected 'Other', input "$(inherited)"
- do same with 'Release' and install your pod
You can follow the image below.
Solution 2
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:
- Go to Project/Targets -> [Project Name] -> Build Settings.
- Find and click on the relevant setting (you can use the search box in the top right corner).
- 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.
Solution 3
(Updated as of July 29, 2018)
- Projects/Targets --> Project Name --> Build Settings
- Build Options
- Click on Always Embed Swift Standard Libraries so that it is highlighted
- 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
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.
Questioner
Updated on July 05, 2022Comments
-
Questioner almost 2 years
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 typepod 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
andEMBEDDED_CONTENT_CONTAINS_SWIFT
toNO
andYES
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
-
Nahouto over 7 yearsI tried to do this but error "no such module" still appears
-
AWebster over 7 yearsThis worked for me to fix the pod install/update. However Xcode (8) then issued a warning to update settings and revert the changes.
-
Zayin Krige over 7 yearsbit of a shotgun approach, but yeh, a clean install often helps
-
Naloiko Eugene over 7 yearsI had to set it this way for the PROJECT, and all TARGETS. And no more warnings in the terminal :)
-
Iulian Onofrei over 7 yearsWhy isn't cocoapods doing this on
init
? -
Sébastien REMY over 7 yearsit's make a lost of warning to me :(
-
pableiros over 7 years@iLandes this is what is worked for me, maybe you are doing something different to get all the lost of warnings
-
Chlebta over 7 yearsI get always
No - $(inherited)
I can't set it toYES- $(inherited)
like in screenshot -
Stark over 7 yearsJust choose Other. Follow my step3
-
Verticon over 7 yearsThis worked for me: pod install no longer generates warning. I did it for both of my target settings; App and Tests. I did not do it for the project settings.
-
uɥƃnɐʌuop about 7 years@Chlebta, that happened to me, too, but it was because I was setting the
$(inherited)
under theProject
section and not under theTargets
section (as shown in the snapshot in the Projects & Targets list). Also, having not set the correctALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
variable, cocoapods was still giving me the warning. -
Juan about 7 yearsSo, the steps to fix it are: 1st.- Remove the SD (in the finder) 2nd.- Delete the project in the simulator 3rd.- Import SD again If so, next time try to edit and give a better format to your answer. Welcome to SO.
-
Ariven Nadar almost 7 yearsThanks it worked, but it will not effect any other functionality right ?
-
BennyTheNerd almost 7 years@ArivenNadar, no, not that I'm aware of
-
Admin almost 7 years07/10/2017, This solution worked for me in a mixed Swift/Obj C Project/Pods
-
Idrees Ashraf almost 7 years@Chlebta select "Yes" and then select "Other..." now input $(inherited).
-
user805981 over 6 yearsI'm still getting warnings 2017/10/23.... To get this working you must go through all targets and make sure they are all not bold. This includes Test as well.