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.
Scroll down and You got logs like, in my case
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:
- Clean Product
- Clean Build Folder
- Open derived data folder from Xcode
- Quit XCode
- Delete Derived data
- Delete derived data from Trash as well
- Open Xcode
- Run your app
If this doesn't solve your problem, remove your account and add it again using below steps:
- Open Preferences from XCode menu
- Goto Accounts
- Select your developer account under Apple IDs
- Remove that account
- 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
Retrieve Custom Prototype Cell Height from Storyboard
Autolayout with Hidden Uiviews
Uisearchbar Increases Navigation Bar Height in iOS 11
Workaround on the Threads Limit in Grand Central Dispatch
How to Change Device Volume on iOS - Not Music Volume
Getting the Word Touched in a Uilabel/Uitextview
Load View from an External Xib File in Storyboard
Unique Identification of iOS Device for iOS 7.0 and Above
Setneedslayout VS. Setneedsupdateconstraints and Layoutifneeded VS Updateconstraintsifneeded
Exhaustive Condition of Switch Case in Swift
How to Achieve a "Clock Wipe"/ Radial Wipe Effect in iOS
Converting iPhone Xib to iPad Xib
Resize Uiimage to 200X200Pt/Px
Record and Play Audio Simultaneously
Working with C APIs from Swift
How to Dismiss the Keyboard When Editing a Uitextfield
Creating a Shadow for a Uiimageview That Has Rounded Corners