我正在尝试使用 Xcode 9 beta 6 (9M214v) 构建我的项目。另外,我正在使用 CocoaPods。我已转换为 Swift 4 并更新了我的项目设置,但我一直收到此错误。
到目前为止我尝试过的事情:
- 清理项目并构建文件夹
- 删除/重新添加 pod
- 重启 Xcode
- 移除
事件编译条件
标志
有人知道如何解决这个问题吗?
错误信息:
<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
播客文件
target 'iOS Application' do
use_frameworks!
pod 'SwiftLint'
pod 'RealmSwift'
pod 'ReachabilitySwift'
pod 'Fabric'
pod 'Crashlytics'
end
最佳答案
发现错误!在我的 iOS 应用程序
目标的build设置中,位于 Swift Compiler - Custom Flags > Other Swift Flags
。在标志的末尾有一个 ", 而不是 "。我不知道这是怎么发生的,但引号导致了错误。
关于xcode - 错误 : conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG” '),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45876616/