You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iOS: livekit-react-native-webrtc links no React under dynamic frameworks + prebuilt React-Core (undefined RCTEventEmitter/RCTView/RCTRegisterModule); Swift companion needs the non-modular include allowance #436
One report covering the two podspecs because the failures are coupled (@livekit/react-native@2.11.1 + @livekit/react-native-webrtc@144.1.1, both re-verified today; podspecs unchanged on main/master).
Under use_frameworks! :linkage => :dynamic with Expo SDK 56's precompiled React-Core (prebuilt React.framework distribution):
livekit-react-native-webrtc builds a dylib that never links React. The podspec declares s.dependency 'React-Core', but with the prebuilt React-Core pod that dependency contributes framework search paths only — no -framework React makes it onto the link line of this pod's dynamic framework. Release builds fail at link time with undefined React symbols referenced by the pod's ObjC sources: RCTEventEmitter, RCTView, RCTRegisterModule (from RCT_EXPORT_MODULE).
With the link fixed, module verification then rejects the pod's non-modular React includes — the longstanding #import <React/RCTConvert.h>-style includes every classic RN pod ships (same class of errors as Android Fails to build #60 shows on livekit/react-native-webrtc: "Include of non-modular header inside framework module 'livekit_react_native_webrtc...'"). The Swift companion pod livekit-react-native compiles the webrtc framework module from Swift, so it needs CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES as well — stock RN pods set exactly this.
To Reproduce
Expo SDK 56 app with expo-build-properties → "useFrameworks": "static" off, i.e. dynamic frameworks (use_frameworks! :linkage => :dynamic), precompiled React-Core enabled (SDK 56 default when available).
Add @livekit/react-native + @livekit/react-native-webrtc, pod install, build Release for device.
Link step for livekit-react-native-webrtc.framework fails: undefined symbols RCTEventEmitter, RCTView, RCTRegisterModule.
Add -framework React to that pod (e.g. via post_install) and rebuild → non-modular-header module verification errors surface next, in both pods.
Expected behavior
Both pods build out of the box under dynamic frameworks + prebuilt React-Core.
Suggested fix
We run these podspec changes as local patches; they make the stack build cleanly:
--- a/livekit-react-native-webrtc.podspec+++ b/livekit-react-native-webrtc.podspec
@@
# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
- 'DEFINES_MODULE' => 'YES'+ 'DEFINES_MODULE' => 'YES',+ # Under a prebuilt React-Core the framework search paths are present but+ # React is never linked into this dylib, leaving+ # RCTEventEmitter/RCTView/RCTRegisterModule undefined at link time.+ 'OTHER_LDFLAGS' => '$(inherited) -framework React',+ # The (upstream, longstanding) non-modular React header includes are the+ # same includes every classic RN pod ships. Match the stock RN pod settings.+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES'
}
--- a/livekit-react-native.podspec+++ b/livekit-react-native.podspec
@@
# Swift/Objective-C compatibility
- s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }+ s.pod_target_xcconfig = {+ # Its webrtc dependency's framework module carries non-modular React+ # includes; allow them when this Swift pod builds that module.+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',+ 'DEFINES_MODULE' => 'YES' }
Notes:
Guarding -framework React behind an env/React-Core-variant check may be desirable if plain (non-prebuilt) React-Core setups need -framework React-Core instead; in our testing $(inherited) -framework React is what the prebuilt distribution requires.
Locally we additionally set ENABLE_MODULE_VERIFIER=NO on both pods; that part is our own choice for build-time reasons and deliberately not part of this ask — the allowance flag above is what stock RN pods use.
Describe the bug
One report covering the two podspecs because the failures are coupled (
@livekit/react-native@2.11.1+@livekit/react-native-webrtc@144.1.1, both re-verified today; podspecs unchanged onmain/master).Under
use_frameworks! :linkage => :dynamicwith Expo SDK 56's precompiled React-Core (prebuiltReact.frameworkdistribution):livekit-react-native-webrtcbuilds a dylib that never links React. The podspec declaress.dependency 'React-Core', but with the prebuilt React-Core pod that dependency contributes framework search paths only — no-framework Reactmakes it onto the link line of this pod's dynamic framework. Release builds fail at link time with undefined React symbols referenced by the pod's ObjC sources:RCTEventEmitter,RCTView,RCTRegisterModule(fromRCT_EXPORT_MODULE).With the link fixed, module verification then rejects the pod's non-modular React includes — the longstanding
#import <React/RCTConvert.h>-style includes every classic RN pod ships (same class of errors as Android Fails to build #60 shows on livekit/react-native-webrtc: "Include of non-modular header inside framework module 'livekit_react_native_webrtc...'"). The Swift companion podlivekit-react-nativecompiles the webrtc framework module from Swift, so it needsCLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULESas well — stock RN pods set exactly this.To Reproduce
expo-build-properties→"useFrameworks": "static"off, i.e. dynamic frameworks (use_frameworks! :linkage => :dynamic), precompiled React-Core enabled (SDK 56 default when available).@livekit/react-native+@livekit/react-native-webrtc,pod install, build Release for device.livekit-react-native-webrtc.frameworkfails: undefined symbolsRCTEventEmitter,RCTView,RCTRegisterModule.-framework Reactto that pod (e.g. via post_install) and rebuild → non-modular-header module verification errors surface next, in both pods.Expected behavior
Both pods build out of the box under dynamic frameworks + prebuilt React-Core.
Suggested fix
We run these podspec changes as local patches; they make the stack build cleanly:
Notes:
-framework Reactbehind an env/React-Core-variant check may be desirable if plain (non-prebuilt) React-Core setups need-framework React-Coreinstead; in our testing$(inherited) -framework Reactis what the prebuilt distribution requires.ENABLE_MODULE_VERIFIER=NOon both pods; that part is our own choice for build-time reasons and deliberately not part of this ask — the allowance flag above is what stock RN pods use.Device Info:
@livekit/react-native2.11.0–2.11.1,@livekit/react-native-webrtc144.1.0–144.1.1Related: livekit/react-native-webrtc#60 (the non-modular-header symptom, reported against static-frameworks setups).