From 6faf44c13010b9c4f9d0783c32a0fd955ab49188 Mon Sep 17 00:00:00 2001 From: Christian Falch Date: Tue, 26 Aug 2025 11:10:30 +0200 Subject: [PATCH] [ios][precompiled] add SWIFT_ENABLE_EXPLICIT_MODULES to xcode 26 XCode 26 introduces building explicit swift modules turned on (SWIFT_ENABLE_EXPLICIT_MODULES). This breaks building with precompiled binaries. This commit fixes this by adding a step when not building from source where we explicitly set the `SWIFT_ENABLE_EXPLICIT_MODULES` flag to `NO`. --- packages/react-native/scripts/react_native_pods.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 65a30b0a8d60..eea328043ae8 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -503,6 +503,13 @@ def react_native_post_install( ReactNativePodsUtils.updateOSDeploymentTarget(installer) ReactNativePodsUtils.set_dynamic_frameworks_flags(installer) ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer) + + if !ReactNativeCoreUtils.build_rncore_from_source() + # In XCode 26 we need to revert the new setting SWIFT_ENABLE_EXPLICIT_MODULES when building + # with precompiled binaries. + ReactNativePodsUtils.set_build_setting(installer, build_setting: "SWIFT_ENABLE_EXPLICIT_MODULES", value: "NO") + end + SPM.apply_on_post_install(installer) if privacy_file_aggregation_enabled