Linker Command Failed with Exit Code 1 (Use -V to See Invocation), Xcode 8, Swift 3

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.

Sample Image

Scroll down and You got logs like, in my case

Sample Image

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)

ERROR swiftc failed with exit code 1 when converting to latest syntax

Have you tried to do clean with Clean build folder?

The combination keys is:

ALT + SHIFT + COMMAND + K

iOS Archive Fails: Command /usr/bin/ditto failed with exit code 1

This was a bug that has been fixed with recent versions of Xcode as of version 8.

Xcode 8.0 Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

The problem went away by itself for mysterious reasons. Instead of the whimsical linking error I got a new bunch of errors due to Swift 3 fling which the app compiles and run fine.

Shell script invocation error command /bin/sh failed with exit code 1

In my case:

  1. Clean Product
  2. Clean Build Folder
  3. Open derived data folder from Xcode
  4. Quit XCode
  5. Delete Derived data
  6. Delete derived data from Trash as well
  7. Open Xcode
  8. Run your app

If this doesn't solve your problem, remove your account and add it again using below steps:

  1. Open Preferences from XCode menu
  2. Goto Accounts
  3. Select your developer account under Apple IDs
  4. Remove that account
  5. Add your account back

This should solve your problem.

Xcode Command /usr/bin/codesign failed with exit code 1 : errSecInternalComponent

Open Keychain Access, then in the File menu select Lock All Keychains.

Then go back to Xcode and clean and rebuild. It will prompt you for your password again to unlock the keychain.

After this, assuming you have no other compile issues, it will succeed!



Related Topics



Leave a reply



Submit