using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code
Asked Answered
G

4

10

I have razor pay pod in my project for payment gateway and SWRevelViewController file for side bar controller. I selected the swift 5 and iOS version 13 and updated all the pods but still getting error

error: using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code

pod 'Alamofire', '~> 4.5' pod 'TWMessageBarManager'
pod 'SwiftValidator', :git => 'https://github.com/jpotts18/SwiftValidator.git', :tag => '4.2.0'

pod 'SDWebImage', '~> 5.0'
pod 'DropDown'
pod 'MBRadioCheckboxButton'
pod 'SwiftyJSON', '~> 4.0'
pod 'razorpay-pod', '~> 1.1.1'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Firebase/Auth'
pod 'SVProgressHUD'     
pod 'FacebookLogin'
pod 'FacebookCore'
pod 'ImageSlideshow', '~> 1.8.0'
pod "ImageSlideshow/SDWebImage"
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'PopupDialog', '~> 1.1'
pod 'GoogleSignIn'
pod 'AppAuth','~> 1.2.0'
Grissel answered 11/3, 2020 at 5:18 Comment(17)
Please check your bridging header file path.Whitsun
Ok I will check, is there any other issuesGrissel
99% i am sure, you didn't set properly, please refer this link : https://mcmap.net/q/1160805/-how-to-find-path-of-bridging-header-h-swift-xcodeWhitsun
I referred that answer but still, it's not working, same error, what can I do now?Grissel
Can i ask your Xcode version? And also make sure all pod files available in swift 5 or not because you selected swift 5 and For Xcode 11, you need to use CocoaPods 1.8.4 and nothing older.Whitsun
it's Xcode Version 11.3 (11C29) and I am also using CocoaPods 1.8.4Grissel
Disable batch mode by adding a user-defined build setting named SWIFT_ENABLE_BATCH_MODE and set it to NO. Go to your target's build settings and add this user-defined setting.Whitsun
Ok, mam, I will check it and let you know, how it worksGrissel
Yes pod swift version and try batch mode, if not working than let me know..!!Whitsun
I added user-defined setting and set it to no but I am unable to add this in targetGrissel
I have sent the screenshots on LinkedinGrissel
Remove from your bridging header file path : /Users/sjainmac/Downloads/TrippyCarApp7M20Whitsun
ok I am going to checkGrissel
I did, I removed extra lines but still, it's not working same errorGrissel
whatever I am doing I am getting that same error again and again.Grissel
any update mam.Grissel
Yes i update you in linkedIn...! Thank youWhitsun
W
5

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.

Whitsun answered 18/3, 2020 at 4:43 Comment(3)
It works fine now, Thank you so much Anjali mam. I and dont have that much reputation yet your ans works, made my day. Thank you so much.Grissel
My header file has only 1 line #import "GeneratedPluginRegistrant.h". Is this correct?Keramic
That would be SWIFT_OBJC_BRIDGING_HEADER.Cohn
D
28

In my case, i had to follow these steps:

Step 1:

config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'NO'

enter image description here

in my Podfile under

...

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      # Put it here (indent like this)
  ...

Step 2

  • Select Runner on the left Panel
  • Under Targets, select the target (usually "Runner")
  • Select Build Settings from the top Menu
  • Scroll down to Build Options and find the option "Build Libraries for Distribution"
  • Set the value of "Build Libraries for Distribution" to NO (or set it for any particular build scheme)
  • Clean Build Folder
  • Delete flutter "build" folder, run flutter clean & flutter pub get

enter image description here

Dipole answered 29/10, 2022 at 5:57 Comment(1)
Thank you so much, but make sure to add "end" after target.build_configurations.each do |config| otherwise you got an errorAli
W
5

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.

Whitsun answered 18/3, 2020 at 4:43 Comment(3)
It works fine now, Thank you so much Anjali mam. I and dont have that much reputation yet your ans works, made my day. Thank you so much.Grissel
My header file has only 1 line #import "GeneratedPluginRegistrant.h". Is this correct?Keramic
That would be SWIFT_OBJC_BRIDGING_HEADER.Cohn
K
1

So I faced a problem with Razorpay swift version and following one of the suggested methodologies set Target>Build Libraries for Distribution to Yes.

Big mistake.

kept getting error: using bridging headers with module interfaces is unsupported

Finally fixed it by setting Build Libraries for Distribution Back to No [Razorpay issue was still not resolved so had to downgrade Flutter]

Karoline answered 24/11, 2021 at 21:38 Comment(1)
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From ReviewLorenelorens
F
-1

I have solved it in this way, Detailed steps are here, Solution to Xcode Error: using bridging headers with module interfaces is unsupported

Solution:

In your Project Level & Target level Build Settings tab, open the Build Options menu. And then set Build Libraries for Distribution option to No.

Final answered 26/7, 2020 at 8:43 Comment(3)
The accepted answer says to set it to YES. This is confusing..Bicephalous
Not a solution. Plus, you're posting a link to your own blog or whatever instead of answering the question in here.Vyborg
It is not a solution as if you need to prepare the lib for distribution you need to have this option as YESSoso

© 2022 - 2025 — McMap. All rights reserved.