Cocoapods: Target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` 1.2.0 Beta 1 issue

Created on 4 Nov 2016  ·  21Comments  ·  Source: CocoaPods/CocoaPods

ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with
what info we expect.
Please remove this line and all above before submitting.

Before you start, are you using the CocoaPods beta release?
a lot has changed with Xcode 8 that is not backwards compatible.

Xcode 8 Status: Only works with CocoaPods 1.1.0
Swift 3: You need to add a .swift-version file, see the CHANGELOG
China: Use https://gems.ruby-china.org/ instead of https://gems.ruby-china.org/ for the RC see #5910

Report

What did you do?

Getting an error when doing pod install after switching to Xcode 8.1 and converting to Swift 3.

gatewaysmacpro:projecta-app gateway$ pod --version
1.2.0.beta.1
gatewaysmacpro:projecta-app gateway$ pod install
Analyzing dependencies
Downloading dependencies
Installing ARSLineProgress (2.0.2.1)
Installing Bolts (1.8.4)
Installing FBAnnotationClusteringSwift (1.0.1)
Installing FBSDKCoreKit (4.17.0)
Installing FBSDKLoginKit (4.17.0)
Installing HMSegmentedControl (1.5.3)
Installing MXPagerView (0.1.4)
Installing MXParallaxHeader (0.6.0)
Installing MXSegmentedPager (3.2.0)
Installing Parse (1.14.2)
Installing ParseFacebookUtilsV4 (1.11.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 7 dependencies from the Podfile and 11 total pods installed.

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

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

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

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

Pod File

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target "ProjectA" do
    pod 'Parse'
    pod 'ParseFacebookUtilsV4'
    pod 'FBAnnotationClusteringSwift'
    pod 'ARSLineProgress', '~> 2.0'
    pod 'Bolts'
    pod 'HMSegmentedControl'
    pod 'MXSegmentedPager'

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

image

ℹ Please replace this with what you did.

Ran pod install

CocoaPods Environment

ℹ Please replace this with the output of pod env.

gatewaysmacpro:projecta-app gateway$ pod env

### Stack

CocoaPods : 1.2.0.beta.1
Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
RubyGems : 2.0.14.1
Host : Mac OS X 10.12.1 (16B2555)
Xcode : 8.1 (8B62)
Git : git version 2.9.3 (Apple Git-75)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 441c6a66108608ec8bce8d85b086f434989a76cc

### Installation Source

Executable Path: /usr/local/bin/pod

### Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.1.1
cocoapods-try : 1.1.0

### Podfile

```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target "ProjectA" do
    pod 'Parse'
    pod 'ParseFacebookUtilsV4'
    pod 'FBAnnotationClusteringSwift'
    pod 'ARSLineProgress', '~> 2.0'
    pod 'Bolts'
    pod 'HMSegmentedControl'
    pod 'MXSegmentedPager'

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

```

Anyone have ideas?

awaiting input

All 21 comments

same issues 👍

@gateway can you post a screenshot of the "Levels" view of that build setting? Right now, we're seeing the "Levels" view.

@gateway also if the target that's blurred in the screenshot where the setting is No is using any of those pods in your Podfile that use Swift, then that setting will need to be Yes (unless that target is an app extension). In that case, you should remove this setting there so that CocoaPod's can take precedence, since CocoaPods should be setting it properly. You can do this by highlighting that setting there and pressing backspace.

@benasher44 Hmm, our xcode project is in conversion to swift 3 hell right now so I cant do any testing with the pods. We are not setting legacy to Yes since we wont be using 2.3. I'm not sure on that last bit what you meant on the last part.. you want me to remove that out of xcode? Guess I need a bit more info on that.

Here is levels screen shot

image

Oh sorry I was referring to the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES and not the legacy swift version flag. Still staring at this and thinking

Hmm. I don't see any issue here. This might be something that's transient and only happens once while your project file transitions to using this new flag from old one. Can you try running pod install again to see if you still get this message?

I got rid of the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES warnings by setting it to $(inherited) in the appropriate targets, since CocoaPods sets it for you. Also, looking at your Podfile you seem to be using a post_install hook to set SWIFT_VERSION to 3.0 on all Pods, which isnt needed anymore, just use a .swift-version file in the root of your project.

.swift-version only helps if you're verifying a pod that you're distributing for operations like pod lib lint, pod spec lint, pod trunk push, or pod repo push. It won't have any effect on your Xcode project. The Swift version used for your pods will be the Swift version specified in your main targets in your project.

I'm going to have to get back to you guys once our project is compiling due to all the crap we are dealing with now with swift 3.0..

You're right, apologies for the misinformation. Surely post install hooks to set the version arent needed with 1.2.0 though.

Correct! As of 1.1.0, it'll use the Swift version set in your project as the version to use to build your pods.

Ok, sorry for the late reply got busy and just wanted to know our project is back up and running however I'm still getting this issue and not 100% sure what to do, a few suggestions above with .swift-version etc do not work and as mentioned are no longer needed..

Any ideas what I can try?

@gateway for the targets that are managed by CocoaPods that use Swift pods, when you go to those targets in Xcode, are the "Always Embed…" settings in bold?

@benasher44 where would I find the Always embed setting?

image

In the search bar there in the top right, you can just "Always", and that should filter it enough for it to show up.

Oh. You'll need to select a target in your project. It looks like you have the Pods project selected there, but you need to have a target in your project selected (preferably one that is mentioned in your Podfile).

image

Great! So now if you select "Always Embed Swift Standard Libraries" and just hit the backspace key, that should unbold it, which means this target is no longer overriding it (not the greatest UI).

@benasher44 thanks ill test it tomorrow when in the office.. is this a standard thing everyone will need to do because we never set this, so its a bit confusing ;)

Closing due to lack of activity. If this is still a problem please file a new issue, including a sample project.

I have the same issue. any fixed ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steffendsommer picture steffendsommer  ·  3Comments

pronebird picture pronebird  ·  3Comments

luhui picture luhui  ·  3Comments

hmistry picture hmistry  ·  3Comments

Mingmingmew picture Mingmingmew  ·  3Comments