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)
Xcode - Swift Compiler Error For Bridging header
I just fixed this by using just spaces instead of hyphens or backslash and spaces. Simple enough.
Swift Bridging Header import issue
Be careful to add the file to the folder that your error is complaining!
I've made the same mistake, if you create the file from Xcode, it will go to the folder: Project->Project->Header.h
And Xcode is looking for Project->Header.h
That means you need to put the file inside your project folder (ProjectName->ProjectNameFolder)!
Hope that helps ;)
UPDATED:
I'm not sure if I got what you mean, but try this to solve your problem:
1. Delete all your bridging files that you created until now.
2. Select the main folder of project and hit new file->iOS->Header file.
3. Write your imports in the header file created.
4. Select the project inside Xcode->Build Settings, type in search field: bridging and put in the key SWIFT_OBJC_BRIDGING_HEADER the name of your header file or the path to it!
If you follow this steps, your header file will be created at the correct location!
:D Hope that helps!
using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code
I checked your problem and as per you selected project language project work properly in XCode 10.2 but you require changes for updated XCode 11.2.1
Please follow few things :
- Make sure first your bridging header file path is proper in build settings.
- You need to update razor pay pod because you add tag (pod 'razorpay-pod', '~> 1.1.1'), and pod updated in Swift 5.1 so please remove it and change pod name with
pod 'razorpay-pod'
- Please change your build settings. Set Build Library for Distribution in the build settings for the target framework to YES.
Hope it’s helpful to you.
All xib and storyboard files crashes Xcode 6.1
Ok, this was some sort of xCode bug. One of my swift files was corrupt somehow, and the fix was simply deleting it and copying the old content to the new file. Very strange that one SWIFT (!) file could prevent all xib and storyboard files from opening.
My recommendation to anyone having the similar problem is to backup your old project and remove files until xCode works. Then you have identified the problem, and should be able to fix it.
Failed to emit precompiled header for bridging header
I also got exact same issue (Xcode9 beta 6) after I added cocoa pods for Encrypted Core Data.
This is my PodFile
:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'
target 'Root' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Root
target 'RootTests' do
inherit! :search_paths
# Pods for testing
end
target 'RootUITests' do
inherit! :search_paths
# Pods for testing
end
end
Solution:
1 I added $(inherited) non-recursive
to Search Path -> Header Search Paths
2 Then added ${PODS_ROOT} recursive
to Search Path -> User Header Search Paths
Both the above in my projects' target build settings.
Please have a look at these SO answers:
1 Inherit Header Search Paths
2 Inherit User Search Paths
Related Topics
Iphone, Obtaining a List of Countries in an Nsarray
Xcode Is Creating Generic Xcode Archive Instead of iOS App Archive
How to Rotate an Uiimageview by 20 Degrees
Nsurlsession "Http Load Failed Kcfstreamerrordomainssl, -9813 ; Self Signing Certificate
How Does One Print All Wkwebview on and Offscreen Content Osx and iOS
Using Custom Fonts in Interface Builder
iOS Provisioning and Certifcates - Will Revoke/Renew Effect App Store Apps
Flutter iOS Build Failed an Error of Pod Files: Podfile Is Out of Date
Right Aligned Uitextfield Spacebar Does Not Advance Cursor in iOS 7
Uiview. Why Does a Subviews Outside Its Parent's Extent Not Receive Touches
Determine Mime Type from Nsdata
Rendering PDF in Uiwebview iOS 8, Causes a Black Border Around PDF
iOS 9.3:An Ssl Error Has Occurred and a Secure Connection to the Server Cannot Be Made
Making Video from Uiimage Array with Different Transition Animations
Uiviewcontroller Prevent View from Unloading
Text Color Based on Background Image