Dan
Dan

Reputation: 303

error: conditional compilation flags must be valid Swift identifiers (rather than 'DEBUG”')

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:

Anyone has an idea how to solve this?

Error message:

<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

Upvotes: 3

Views: 1890

Answers (2)

Huachuan Edward
Huachuan Edward

Reputation: 11

I find when you modify your "x-Code" setting for custom flags "Debug" to delete "-D",and then replace your swift language version to "Swift 4.0" ,It will fix your problem! Hoping help you...

Upvotes: 1

Dan
Dan

Reputation: 303

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.

Upvotes: 3

Related Questions