Today i downloaded the XCode 9.0 Beta 4 and after building my project i get the next warning messages
<unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than '-Xfrontend')
<unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than '-debug-time-function-bodies')
Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
I have tried several options like i have searched it here but cannot find any solution to this.
Anyone on this?
Locate in your project settings and individual target settings the following:
Other Swift Flags
Delete it. Compile.
This issue appeared for me, while I started the app for the first time in Xcode 9.
I had duplicated values in Build Settings -> Other Swift Flags. After removal of duplications the app started to work as expected.
Other Swift Flags cannot have a value that contains a dash "-", but in Swift 3.2 the values do need a "-D" prefix
At some point, you or a coworker included those flags to see how long Xcode takes Swift files to compile. You can remove them as they don't affect compilation. Not sure if they are still supported but if they are, Active Compilation Conditions
don't take the format of starting with a dash anymore it seems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With