xcode 8 swift update with error“Use Legacy Swift Language Version” [英] xcode 8 swift update with error "Use Legacy Swift Language Version"

查看:265
本文介绍了xcode 8 swift update with error“Use Legacy Swift Language Version”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开我的项目到Xcode 8,然后我得到以下错误

 使用旧版Swift语言版本(SWIFT_VERSION)需要为使用Swift的目标正确配置。使用菜单选择一个Swift版本或使用构建设置编辑器直接配置构建设置

引用StackOverflow上的类似



解决方案

将此文件添加到您的pod文件:

 #取消注释此行以为您的项目定义一个全局平台
platform:ios,'9.0'
#取消注释如果你使用Swift
use_frameworks!

target'yourappname'do

pod'yourpodlists'

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'
end
end
end
end

再次运行pod-install。使用 cdm + alt + shift + k 清除您的项目。使用 cmd + shift + k 再次清理。重新启动Xcode。建立。



如果你不使用cocoapods,你应该能够通过设置编译器版本属性来修复这个问题 Use Legacy



创建项目或库的设置 - >




When i opened my project into Xcode 8 then I got the following 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

referring to a similar post on StackOverflow , Use Legacy Swift Language Version YES/NO . But it's not working for me either by doing YES or No value ?

Please help.

I have checked Use Legacy Swift Language Version to options YES/NO please check attached screenshot

解决方案

Add this to your pod-file:

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'yourappname' do

pod 'yourpodlists'

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

Run pod-install again. Clean your project with cdm + alt + shift + k. Clean again using cmd + shift + k. Restart Xcode. Build. Now it should work.

If you're not using cocoapods, you should be able to fix this issue by setting the Compiler Version attribute Use Legacy Swift Language Version from unspecified to Yes or No.

Build settings of the project or library ->

这篇关于xcode 8 swift update with error“Use Legacy Swift Language Version”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆