Ludo Ludo - 1 month ago 16
iOS Question

Migrating Alamofire 4 on swift3 - Linker command failed with exit code 1 (use -v to see invocation

I am migrating to swift 3 and so updated to Alamofire 4 and I am getting this error :

Linker command failed with exit code 1 (use -v to see invocation)


with this detail

.../Alamofire.framework/Alamofire compiled with older version of Swift language
(2.0) than previous files (3.0) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Here is my pod file:

pod 'Alamofire', '~> 4.0'
end

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


I do not know if it is linked, but I have also this warning when updating pods:

[!] The `MyProject [Release]` target overrides the
`ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target
Support Files/Pods-bbsigne/Pods-bbsigne.release.xcconfig'.
This can lead to problems with the CocoaPods installation


How to solve this error ?

Answer

Try these steps:

  1. Delete derived data of your project
  2. Clean your project (Cmd+Shift+K)
  3. Run pod update from terminal once again

To delete derived data in Xcode 8 do the following:

File -> Workspace settings -> Press arrow button next to the path -> Open DerivedData folder -> Delete folder starting with your project`s name