2

My app works on the simulator when I run: npx react-native run-ios

However when I try to get the ipa file by 'Archive'-ing it via the .xcworkspace I get the following error regarding WebRTC and bitcode.

How to fix this issue?

ld: '/Users/bliss/Library/Developer/Xcode/DerivedData/DanceConnectyCube-czcpkmpwkpsbethjfvbfindeabwg/Build/Intermediates.noindex/ArchiveIntermediates/DanceConnectyCube/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/react-native-webrtc/WebRTC.framework/WebRTC' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/bliss/Library/Developer/Xcode/DerivedData/DanceConnectyCube-czcpkmpwkpsbethjfvbfindeabwg/Build/Intermediates.noindex/ArchiveIntermediates/DanceConnectyCube/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/react-native-webrtc/WebRTC.framework/WebRTC' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

preston
  • 3,721
  • 6
  • 46
  • 78

2 Answers2

3

you need to remove bitcode in your ios project setting in xcode target->build settings-> enable bitcode or use a custom webrtc build that enable it at compile time (huge build). I made one here

edit: a build with bitcode and swiftmodule support This Repo also have sh script that explain the procedure.

Pierre Noyelle
  • 478
  • 3
  • 8
  • Is the one you made bitcode enabled? – tanmoy Jan 10 '22 at 05:31
  • @MuhtasimUlfatTanmoy i have both released with and without bitcode. I made an other repository with the procedure explained in SH script and swiftmodule build, link in edit section. The best is that you compile your own if you need it for commecial app. – Pierre Noyelle Jan 11 '22 at 15:24
3

For those came here with the same error:

If you are trying to debug your app in your iPhone you have to select bitcode=no in order to work.

enter image description here

Isidoros Moulas
  • 520
  • 3
  • 10