Swift Failed with Exit Code 1 While Compiling in Xcode - Possibly Related to Bridging-Headers

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)

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 :

  1. Make sure first your bridging header file path is proper in build settings.
  2. 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'
  3. 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



Leave a reply



Submit