Cocoapods: EMBEDDED_CONTENT_CONTAINS_SWIFT

Created on 19 Jan 2016  路  15Comments  路  Source: CocoaPods/CocoaPods

CocoaPods is giving me the following error today

[!] The `myapp [Release]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-myapp/Pods-myapp.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
 [!] The `myapp [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-myapp/Pods-myapp.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
   - Remove the build settings from the target.
> [!] The `myapp [Release]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-myapp/Pods-myapp.release.xcconfig'. This can lead to problems with the CocoaPods installation
>     - Use the `$(inherited)` flag, or
>     - Remove the build settings from the target.

PODFILE

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'

target 'myapp' do 
use_frameworks!
pod 'GoogleMaps'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod 'FMDB'
pod 'KYDrawerController'
end

I am using 1.0.0.beta.2

Most helpful comment

@Kkhattab - http://stackoverflow.com/questions/34445636/why-is-cocoapods-complaining-about-the-embedded-content-contains-swift-setting-i you should follow that, just put $inherited as a value. Someone close this, please. I just had a similar problem and I thought one might find this issue in the future.

All 15 comments

Did you follow the instructions in the warning?

Yes if I change it, it will change back with every pod install or pod update.

You deleted the override from your own targets and not CocoaPods' targets?

Override? I just changed the Pods-myApp/Pods-myApp.release.xcconfig, EMBEDDED_CONTENT_CONTAINS_SWIFT from YES to NO. It works but I don't want to have to update this manually everytime I run a pod update. So is there a way to override this so I don't have to do that?

That's not what the warning is telling you to do -- its telling you to delete the setting from your own app target so that the correct CocoaPods-supplied build setting is used. Doing otherwise is at your own peril, and unsupported by the CocoaPods team.

If EMBEDDED_CONTENT_CONTAINS_SWIFT is YES then the app wont be accepted in the App Store. So why would this ever need to be set?

Because otherwise the swift runtime dylibs might not be copied. The iTC failure is detailed in another issue (https://github.com/CocoaPods/CocoaPods/issues/4515), where we've asking for someone to contribute a fix several times already.

@segiddins how do i delete Embedded Content Contains Swift Code Settings ... hitting the delete key in my apps targets does not remove anything.

@Kkhattab - http://stackoverflow.com/questions/34445636/why-is-cocoapods-complaining-about-the-embedded-content-contains-swift-setting-i you should follow that, just put $inherited as a value. Someone close this, please. I just had a similar problem and I thought one might find this issue in the future.

Been struggling a lot with what this setting actually means and I think I may have figured it out. Please reopen issue if you agree with me.

TL;DR Only applies to Objective-C app builds and should never be set to YES for framework builds.

Our product involves building a framework whose dependencies are managed by cocoapods 1.0. Unfortunately, cocoapods is setting this configuration to YES and each of our frameworks are 59M in size because of the included swift runtime libararies.

My understanding is that this setting is only for objective C apps. The app must examine all the frameworks it is embedding using otool. If any of them contain swift code it must set YES for this configuration. See here: https://developer.apple.com/library/content/qa/qa1881/_index.html

More importantly, here's a note from the above link:

Important: To prevent having multiple copies of Swift libraries in your app, make sure that Embedded Content Contains Swift Code is set to NO in your embedded content

So frameworks must really never set this to YES.

@daku , sounds reasonable.

@segiddins do you have any comment?

I don't believe we set this on framework targets. It's only set on targets that frameworks are integrated into, if we can tell that any of the pods you're integrated contain swift.

Hi @benasher44 , just want to know the exact recommended solution to remove the warning CocoaPods tells us. Thanks!

Does the following solution work for our product?

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";

I would expect the latter works.

@benasher44, thanks.
I get a link who met this issue and provided the same solution for this.

Was this page helpful?
0 / 5 - 0 ratings