错误:条件编译标志必须是有效的Swift标识符(而不是“ DEBUG”) [英] error: conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG”')
问题描述
我正在尝试使用Xcode 9 beta 6(9M214v)构建我的项目。另外,我正在使用CocoaPods。我已经转换为Swift 4并更新了项目设置,但仍然出现此错误。
I'm trying to build my project with Xcode 9 beta 6 (9M214v). Also, I'm using CocoaPods. I've converted to Swift 4 and updated my project settings, but I keep getting this error.
到目前为止我已经尝试过的事情:
Things I've tried so far:
- 清理项目并构建文件夹
- 删除/重新添加Pod
- 重新启动Xcode
- 删除
活动编译条件
标志
- Clean project and build folder
- Deleting / re-adding pods
- Restart Xcode
- Remove
Active Compilation Conditions
flags
有人知道如何解决这个问题吗?
Anyone has an idea how to solve this?
错误消息:
<unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG"')
Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Podfile
target 'iOS Application' do
use_frameworks!
pod 'SwiftLint'
pod 'RealmSwift'
pod 'ReachabilitySwift'
pod 'Fabric'
pod 'Crashlytics'
end
推荐答案
发现错误!在我的 iOS应用程序
目标的Build Settings中,在 Swift Compiler-Custom Flags>其他Swift标记
。在标志的末尾有一个,而不是。我不知道这是怎么发生的,但是引号引起了错误。
Found the error! In my iOS Application
target's Build Settings, at Swift Compiler - Custom Flags > Other Swift Flags
. There was a ", instead of " at the end of the flag. I have no idea how this happened, but the quotation mark caused the error.
这篇关于错误:条件编译标志必须是有效的Swift标识符(而不是“ DEBUG”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!