Header is not found during archiving a Cordova app ('WebRTC/RTCAudioSource.h' not found)

Issue

I’ve been trying to figure out this issue for a couple of days, but still have no luck.

I have a legacy application based on Ionic v1, Cordova 9 and cordova-ios 6.

We use cordova-plugin-iosrtc for calling feature, and until recently, it was the older version developed by eFace2Face. After facing some issues with microphone permissions, we decided to upgrade to the latest version and it did its work, however now I’m facing the following error when trying to archive (Product -> Archive) the app and upload it to AppStore:

<Path to app>/Plugins/cordova-plugin-iosrtc/cordova-plugin-iosrtc-Bridging-Header.h:8:9: 'WebRTC/RTCAudioSource.h' file not found

If I select simple Build (Product -> Build) everything works as expected.

Here are some details:

  1. cordova-plugin-iosrtc adds `cordova-plugin-iosrtc-Briding-Header.h which imports all WebRTC/* headers and comes with WebRTC.xcframework with all those WebRTC/ headers inside.
  2. The WebRTC framework is included with the main app target.
  3. In build section, Header Search Paths option explicitly includes the paths to the headers for both Debug and Release configurations. I double-checked and altered them dozens of times and couldn’t get them work.
  4. I created a brand new project with cordova-plugin-iosrtc which achieved ok and tried to compare all the possible options, but had no luck.

Since, I’m not an iOS developer at all, maybe someone could suggest what else could be preventing the build from finding the headers?

Solution

For me, the error was thrown not from the main application, but from app extensions which did not include WebRTC.xcframework in the build.
I just created a separate Briding-Header-Extensions.h where I did not include WebRTC/* headers, updated Build settings -> SWIFT_OBJC_BRIDGING_HEADER path and it successfully archived.

Answered By – EternalLight

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published