Skip to content

Commit fcb86cc

Browse files
chrfalchreact-native-bot
authored andcommitted
add SWIFT_ENABLE_EXPLICIT_MODULES to xcode 26 (#53457)
Summary: 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`. ## Changelog: [IOS] [FIXED] - Added setting SWIFT_ENABLE_EXPLICIT_MODULES=NO when using precompiled to support Xcode 26 Pull Request resolved: #53457 Test Plan: ```bash npx react-native-community/cli init MyApp --version nightly --skip-install cd MyApp yarn cd ios bundle install RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install ``` Build above app with Xcode 26 and verify that it no longer fails Reviewed By: motiz88 Differential Revision: D81025367 Pulled By: cipolleschi fbshipit-source-id: 1db7c4d7de07d62f43b355aa784d7d9de478023c
1 parent e6e814c commit fcb86cc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/react-native/scripts/react_native_pods.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,13 @@ def react_native_post_install(
497497
ReactNativePodsUtils.updateOSDeploymentTarget(installer)
498498
ReactNativePodsUtils.set_dynamic_frameworks_flags(installer)
499499
ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer)
500+
501+
if !ReactNativeCoreUtils.build_rncore_from_source()
502+
# In XCode 26 we need to revert the new setting SWIFT_ENABLE_EXPLICIT_MODULES when building
503+
# with precompiled binaries.
504+
ReactNativePodsUtils.set_build_setting(installer, build_setting: "SWIFT_ENABLE_EXPLICIT_MODULES", value: "NO")
505+
end
506+
500507
SPM.apply_on_post_install(installer)
501508

502509
if privacy_file_aggregation_enabled

0 commit comments

Comments
 (0)