Issue
The session replay package (@datadog/mobile-react-native-session-replay v2.12.1) manually sets Folly compiler flags BEFORE calling install_modules_dependencies, causing build errors with React Native 0.81's precompiled XCFrameworks.
Error
'folly/coro/Coroutine.h' file not found
Current Code
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1" # <- Manual Folly flags
xcconfig.merge!({
"DEFINES_MODULE" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
})
end
s.pod_target_xcconfig = xcconfig
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s) # <- Called AFTER manual flags
end
Problem
In React Native 0.81, iOS dependencies ship as precompiled XCFrameworks and install_modules_dependencies handles all New Architecture setup automatically. Manually setting folly_compiler_flags before calling it causes conflicts because those Folly headers don't exist in the precompiled setup.
Fix
Let install_modules_dependencies handle everything when available:
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
xcconfig.merge!({
"DEFINES_MODULE" => "YES"
})
end
else
# Fallback for older RN versions
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
xcconfig.merge!({
"DEFINES_MODULE" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
})
end
end
s.pod_target_xcconfig = xcconfig
Environment
- Package:
@datadog/mobile-react-native-session-replay@2.12.1
- React Native: 0.81.4
- Expo SDK: 54
- Platform: iOS (EAS Build)
Issue
The session replay package (
@datadog/mobile-react-native-session-replayv2.12.1) manually sets Folly compiler flags BEFORE callinginstall_modules_dependencies, causing build errors with React Native 0.81's precompiled XCFrameworks.Error
Current Code
Problem
In React Native 0.81, iOS dependencies ship as precompiled XCFrameworks and
install_modules_dependencieshandles all New Architecture setup automatically. Manually settingfolly_compiler_flagsbefore calling it causes conflicts because those Folly headers don't exist in the precompiled setup.Fix
Let
install_modules_dependencieshandle everything when available:Environment
@datadog/mobile-react-native-session-replay@2.12.1