From 7e41f41cb41e92292d3b821a5aa86e392f2f9ddd Mon Sep 17 00:00:00 2001 From: Aravind <> Date: Tue, 28 Jul 2026 23:41:36 +0530 Subject: [PATCH] fix(ios): wire prebuilt React-Core and allow non-modular React imports for use_frameworks! (RN 0.84+) RN 0.83+ ships a prebuilt React-Core, enabled by default on 0.84+ via RCT_USE_PREBUILT_RNCORE=1. Two problems break RNFB iOS builds: 1. Header resolution: the legacy imports in RNFB's Objective-C sources need the prebuilt React-Core wired via React Native's add_rncore_dependency helper. Called here, guarded with defined? so older react-native versions are unaffected. 2. Framework module validation: when a consumer builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), RNFB compiles as a framework module and Clang rejects the non-modular includes with -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). Setting CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES=YES lets the module validate. The xcconfig is merged into any existing pod_target_xcconfig so per-package settings (e.g. generated TurboModule header search paths) are preserved. This removes the need for the RCT_USE_PREBUILT_RNCORE=0 workaround that forces React-Core to be rebuilt from source. --- packages/analytics/RNFBAnalytics.podspec | 16 ++++++++++++++++ packages/app-check/RNFBAppCheck.podspec | 16 ++++++++++++++++ .../app-distribution/RNFBAppDistribution.podspec | 16 ++++++++++++++++ packages/app/RNFBApp.podspec | 16 ++++++++++++++++ packages/auth/RNFBAuth.podspec | 16 ++++++++++++++++ packages/crashlytics/RNFBCrashlytics.podspec | 16 ++++++++++++++++ packages/database/RNFBDatabase.podspec | 16 ++++++++++++++++ packages/firestore/RNFBFirestore.podspec | 16 ++++++++++++++++ packages/functions/RNFBFunctions.podspec | 16 ++++++++++++++++ .../in-app-messaging/RNFBInAppMessaging.podspec | 16 ++++++++++++++++ packages/installations/RNFBInstallations.podspec | 16 ++++++++++++++++ packages/messaging/RNFBMessaging.podspec | 16 ++++++++++++++++ packages/ml/RNFBML.podspec | 16 ++++++++++++++++ packages/perf/RNFBPerf.podspec | 16 ++++++++++++++++ packages/remote-config/RNFBRemoteConfig.podspec | 16 ++++++++++++++++ packages/storage/RNFBStorage.podspec | 16 ++++++++++++++++ 16 files changed, 256 insertions(+) diff --git a/packages/analytics/RNFBAnalytics.podspec b/packages/analytics/RNFBAnalytics.podspec index cf9126360d..5405b8a6d7 100644 --- a/packages/analytics/RNFBAnalytics.podspec +++ b/packages/analytics/RNFBAnalytics.podspec @@ -39,6 +39,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/app-check/RNFBAppCheck.podspec b/packages/app-check/RNFBAppCheck.podspec index 261264aca2..e622fb2e7a 100644 --- a/packages/app-check/RNFBAppCheck.podspec +++ b/packages/app-check/RNFBAppCheck.podspec @@ -34,6 +34,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/app-distribution/RNFBAppDistribution.podspec b/packages/app-distribution/RNFBAppDistribution.podspec index 2aa00086d4..5cae556f15 100644 --- a/packages/app-distribution/RNFBAppDistribution.podspec +++ b/packages/app-distribution/RNFBAppDistribution.podspec @@ -33,6 +33,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/app/RNFBApp.podspec b/packages/app/RNFBApp.podspec index 7794b7eee4..fde8063009 100644 --- a/packages/app/RNFBApp.podspec +++ b/packages/app/RNFBApp.podspec @@ -44,6 +44,22 @@ Pod::Spec.new do |s| s.dependency "React-Core" end + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if (ENV.include?('FIREBASE_SDK_VERSION')) Pod::UI.puts "#{s.name}: Found Firebase SDK version in environment '#{ENV['FIREBASE_SDK_VERSION']}'" $FirebaseSDKVersion = ENV['FIREBASE_SDK_VERSION'] diff --git a/packages/auth/RNFBAuth.podspec b/packages/auth/RNFBAuth.podspec index 69a8d2e8d9..be62b195da 100644 --- a/packages/auth/RNFBAuth.podspec +++ b/packages/auth/RNFBAuth.podspec @@ -42,6 +42,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/crashlytics/RNFBCrashlytics.podspec b/packages/crashlytics/RNFBCrashlytics.podspec index 47300cdd24..18548d75d7 100644 --- a/packages/crashlytics/RNFBCrashlytics.podspec +++ b/packages/crashlytics/RNFBCrashlytics.podspec @@ -40,6 +40,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/database/RNFBDatabase.podspec b/packages/database/RNFBDatabase.podspec index 020ecc9e2f..682cbf083e 100644 --- a/packages/database/RNFBDatabase.podspec +++ b/packages/database/RNFBDatabase.podspec @@ -47,6 +47,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/firestore/RNFBFirestore.podspec b/packages/firestore/RNFBFirestore.podspec index cadda65679..74f6b2d0ed 100644 --- a/packages/firestore/RNFBFirestore.podspec +++ b/packages/firestore/RNFBFirestore.podspec @@ -46,6 +46,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + # Fail fast for old architecture users, but safely in case the variable goes away # completely in future react-native versions if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') diff --git a/packages/functions/RNFBFunctions.podspec b/packages/functions/RNFBFunctions.podspec index fe0174fadc..1fdeba1c27 100644 --- a/packages/functions/RNFBFunctions.podspec +++ b/packages/functions/RNFBFunctions.podspec @@ -36,6 +36,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + # Fail fast for old architecture users, but safely in case the variable goes away # completely in future react-native versions if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') diff --git a/packages/in-app-messaging/RNFBInAppMessaging.podspec b/packages/in-app-messaging/RNFBInAppMessaging.podspec index 913a93afa0..5ee1df21f5 100644 --- a/packages/in-app-messaging/RNFBInAppMessaging.podspec +++ b/packages/in-app-messaging/RNFBInAppMessaging.podspec @@ -36,6 +36,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/installations/RNFBInstallations.podspec b/packages/installations/RNFBInstallations.podspec index 18b46db1a4..f5818f623e 100644 --- a/packages/installations/RNFBInstallations.podspec +++ b/packages/installations/RNFBInstallations.podspec @@ -36,6 +36,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/messaging/RNFBMessaging.podspec b/packages/messaging/RNFBMessaging.podspec index 0e08df34f6..1367edaa0b 100644 --- a/packages/messaging/RNFBMessaging.podspec +++ b/packages/messaging/RNFBMessaging.podspec @@ -34,6 +34,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/ml/RNFBML.podspec b/packages/ml/RNFBML.podspec index 44b2eefd11..4c7d9a111c 100644 --- a/packages/ml/RNFBML.podspec +++ b/packages/ml/RNFBML.podspec @@ -37,6 +37,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/perf/RNFBPerf.podspec b/packages/perf/RNFBPerf.podspec index 4902987ec5..3a6da9ddae 100644 --- a/packages/perf/RNFBPerf.podspec +++ b/packages/perf/RNFBPerf.podspec @@ -36,6 +36,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/remote-config/RNFBRemoteConfig.podspec b/packages/remote-config/RNFBRemoteConfig.podspec index e5c326ff6c..0d8056a725 100644 --- a/packages/remote-config/RNFBRemoteConfig.podspec +++ b/packages/remote-config/RNFBRemoteConfig.podspec @@ -36,6 +36,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end diff --git a/packages/storage/RNFBStorage.podspec b/packages/storage/RNFBStorage.podspec index 384ba9d7d7..98ca55d62e 100644 --- a/packages/storage/RNFBStorage.podspec +++ b/packages/storage/RNFBStorage.podspec @@ -34,6 +34,22 @@ Pod::Spec.new do |s| install_modules_dependencies(s); + # RN 0.83+ (default on 0.84+) ships a prebuilt React-Core (RCT_USE_PREBUILT_RNCORE=1). + # Wire it up so the legacy header imports resolve against the prebuilt + # framework. Guarded for older react-native versions where the helper is absent. + if defined?(add_rncore_dependency) + add_rncore_dependency(s) + end + + # RNFB's Objective-C sources import headers non-modularly. When a consumer + # builds with use_frameworks! (Expo's default, and required by the firebase-ios-sdk), + # RNFB is compiled as a framework module and Clang rejects those imports with + # -Wnon-modular-include-in-framework-module ("must be imported from module 'React'"). + # Allow them so the framework module validates. Merge so any existing config is kept. + s.pod_target_xcconfig = (s.to_hash["pod_target_xcconfig"] || {}).merge({ + "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => "YES", + }) + if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0') raise "#{s.name} requires New Architecture. Enable New Architecture to use this module" end