当我在Xcode8中打开我的项目时,我得到以下错误
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
参考StackOverflow上的类似post,请使用旧版Swift语言版本是/否。但对我来说,做YES或No value都不起作用?
请帮帮忙。
我已选中使用旧版Swift语言版本选项是/否,请检查附件中的屏幕截图
发布于 2016-09-21 21:25:55
将以下内容添加到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
再次运行pod-install。使用cdm + alt + shift + k
清理您的项目。再次使用cmd + shift + k
进行清洁。重新启动Xcode。构建。现在它应该可以工作了。
如果您没有使用cocoapods,您应该能够通过将编译器版本属性Use Legacy Swift Language Version
从未指定设置为是或否来修复此问题。
项目或库->的生成设置
发布于 2016-09-22 14:41:08
尝试将swift代码转换为swift3或swift 2.3。edit -> convert -> to current swift->选择swift 3或swift 2.3。这将会起作用。
发布于 2017-02-09 08:50:44
如果您没有使用pods,只需将此代码添加到您的Info.plist中-我在2.3
因为该选项未在构建设置中列出。
https://stackoverflow.com/questions/39616967
复制相似问题