Cocoa pod installation error: " The target overrides the SWIFT_VERSION build setting " Cocoa pod installation error: " The target overrides the SWIFT_VERSION build setting " swift swift

Cocoa pod installation error: " The target overrides the SWIFT_VERSION build setting "


It is a bit non-intuitive but what you have to do is:

1) Search for "SWIFT_VERSION" in your project settings

2) you will see an entry saying "Use Legacy Swift Language Version"

  • If you had already selected any value it will be shown in BOLD

3) Select the entry (not the value) and press "DELETE", the boldness should disappear.

4) Repeat the same steps but now for your target (the one with the app icon)

5) Close XCode

6) Run "pod install" again

7) Open your project, and CLEAN IT (Shift + Command + K)

Now it should be working correctly.

NOTE:

Specifically for "Cocoalumberjack" make sure your pod is installing the 3.0+ version, if its not run a "sudo pod update" as versions previous to this won't work with Swift 3.

EDIT:

I'm pretty sure the cocoapods handling of this is a bit buggy at the moment, as I've experienced sometimes it works and others it doesnt. However, keep in mind you can set the "SWIFT_VERSION" flag directly on a per framework basis:

1) Select the Pods project (within your project).

2) Select the target that you want to set and look for the "SWIFT_VERSION" flag specifically for that target.

3) Clean and rebuild.


You need to remove any overridden "Use Legacy Swift Language Version" build setting from your targets.


That is not exactly helpful as there is no way to remove it.

You either inherit the value, or you assign a value, and there is no way to get back to $(inherited) value after an assignment due to the way the UI is built on xcode (on some options you have a "custom" value where you can add this, but not on all kinds of values).

So it's kind of a dead end with no real solutions.