User511
User511

Reputation: 1486

Linker Error After Updating swift Version and pods

I am installing Alamofire with pods and getting compile time error. There are a lot of questions regarding this but:

Deleting the derived data & updating pods won't work for me.

This is the error:

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

Upvotes: 3

Views: 701

Answers (4)

To fix particular swift pod version:

Code snippet:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == '<insert target name of your pod here>'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.2'
            end
        end
    end
end

Upvotes: 0

Sarabjit Singh
Sarabjit Singh

Reputation: 1824

Update following things in your pod files:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

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

Upvotes: 3

Praveen Deshmukh
Praveen Deshmukh

Reputation: 11

first remove your pods then clean derived data then -You can replace this on .podfile.

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

target 'Meanwise' do
  use_frameworks!
  pod 'pop', '~> 1.0'
  pod 'Alamofire', '~> 4.0'

end

Upvotes: 0

Bista
Bista

Reputation: 7903

Add this at the end of your pod file and run pod install:

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

Upvotes: 2

Related Questions