swift failed with exit code 1 while compiling in Xcode - possibly related to Bridging-Headers

I did the same all answer says but mine issue was not resolved. I did figured out that issue was related to broken function call.

A function syntax was not wrong but its calling mechanism was wrong.

To check the exact error for this issue check following:

Select issue navigator > Click on error will show logs for error > In that select All Messages tab.

This will show all detail logs for this error.

enter image description here

Scroll down and You got logs like, in my case

enter image description here

So, by reading this I figure out that something wrong with function calling. I browse my code and resolved it, Below was correct and wrong code.

Wrong Way:

var region = MKCoordinateRegionMake(self.mapView.userLocation.coordinate, span)
// It will not shown error here but when you build project compiler shows error.

Right Way:

let region = MKCoordinateRegion(center: self.mapView.userLocation.coordinate, span: span)

I run into this last night and nothing above was solving my problem. I was about to do something very bad at my laptop when I saw, all by pure luck, that ONE (1) file was is text encoding set to UTF-16 ?!?! WTF??

enter image description here

This was the last file I was working on, and probably, one bad cut/paste "import" a strange character into the arena. I did a cut/paste of my code in this file to a bare bone text editor. I deleted the file, recreate it and paste back my code... and voilà! it work.

So do the above, but also check your file encoding! :-)


I had the same error message. What helped, was to set the optimization level in the swift compiler settings to None. This is not really a solution for me and I think that's one of the many bugs in the swift compiler.