You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to convert my project from XCode 7 to 8. But and i have following in my pod file: pod 'Alamofire', '~> 4.0'
And i get this error on compilation.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
How to fix this.
ostatnicky, capella55, ndbroadbent, t2davis, husyn and 9 more
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
Jeyhey, Aghassi, nysert, pegurov, mixdesign and 84 morepegurov, davidjhodge, hackiftekhar, ndbroadbent, bad-mushroom and 21 moreTulleb, ndbroadbent, aterribili, italopires, JuanDelgadillo and 20 more
I'm having the same issue and the above fix resulted in:
Module file was created by an older version of the compiler; rebuild 'Alamofire' and try again:
.../path/to/Alamofire.framework/Modules/Alamofire.swiftmodule/arm64.swiftmodule
Here's my Podfile if it helps..
platform :ios, '9.0'
use_frameworks!
target 'my-project' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'
pod 'ChameleonFramework/Swift', :git => 'https://github.com/ViccAlexander/Chameleon.git', :branch => 'swift3'
pod 'SwiftyJSON', :git => 'https://github.com/acegreen/SwiftyJSON.git', :branch => 'swift3'
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
EDIT: Seem to have fixed it by deleting my app's entry in DerivedData and cleaning the project
ergunkocak, whlsxl, elquimista, hamitron, furqanmk and 6 more
@ostatnicky's workaround should not be necessary if you're using CocoaPods 1.1.0, as it adds that setting to your Pods project automatically. As with any upgrade of Xcode and dependencies, clearing your DerivedData folder is always a good idea.
sylvan-d-ash, barbosa, capella55, wgrand, xiaosongshu and 2 more
Hi,
I even deleted derived folder added above code in Podfile but still getting same error "“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly."
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
Activity
Jeyhey commentedon Sep 14, 2016
Have the same error
adrimarti commentedon Sep 14, 2016
Same here
ostatnicky commentedon Sep 14, 2016
Have you tried this? http://stackoverflow.com/a/38466703/1054550
Jeyhey commentedon Sep 14, 2016
Thanks! Worked for me. Hope there are no side-effects.
antsmo commentedon Sep 14, 2016
I'm having the same issue and the above fix resulted in:
Here's my Podfile if it helps..
EDIT: Seem to have fixed it by deleting my app's entry in DerivedData and cleaning the project
jshier commentedon Sep 14, 2016
@ostatnicky's workaround should not be necessary if you're using CocoaPods 1.1.0, as it adds that setting to your
Pods
project automatically. As with any upgrade of Xcode and dependencies, clearing your DerivedData folder is always a good idea.amirpervaiz086 commentedon Sep 21, 2016
Hi,
I even deleted derived folder added above code in Podfile but still getting same error "“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly."
What exactly need to change?
Thanks,
Amir
mengheangrat commentedon Sep 22, 2016
@amirpervaiz086 update your cocoapods
sudo gem install cocoapods --pre
pod install
13 remaining items
yinseng2001 commentedon Sep 25, 2016
i try this , and it work for me.
platform :ios, '9.0'
use_frameworks!
target 'mkhPush' do
pod 'Alamofire', '~> 3.3'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
mfaani commentedon Oct 12, 2016
See this link. He explains, what's going on in detail. And how to fix it.
shrawan2015 commentedon Nov 21, 2016
http://stackoverflow.com/questions/38446097/xcode-8-beta-3-use-legacy-swift-issue/40482708#40482708
Set the Swift version for CocoaPods to be 3.0, to prevent any Xcode b…
techverx commentedon Feb 2, 2017
@ostatnicky's solution worked for me too.
Eddiegooo commentedon Feb 27, 2017
happen to the same problem! must i update my cocoapods to 1.1.0 version to solve this problem?..
who can help me? tks
OK! i have solved it!
you can read Swift开发使用Cocoapods引入第三方库异常处理方法
kumararvind commentedon Mar 17, 2017
I just do Edit->Convert->Current Swift Syntax and error has gone. I did't make any changes in code or Xcode.
It works for me.
Updated podspec targets to use SWIFT_VERSION 3