From 481fa0047880d5013c0fb3ee4f73bf125eb4b0ad Mon Sep 17 00:00:00 2001 From: David Duarte Date: Tue, 31 Mar 2026 14:25:47 +0200 Subject: [PATCH] fix(ios): guard +load with #ifdef RCT_DYNAMIC_FRAMEWORKS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The +load methods in RNCSafeAreaProviderComponentView and RNCSafeAreaViewComponentView are unconditional, but their parent RCTViewComponentView correctly guards its +load behind #ifdef RCT_DYNAMIC_FRAMEWORKS. Without the guard, these +load methods run even when dynamic frameworks are not used, causing conflicts with third-party SDKs (e.g. Akamai BMP) that also use +load — particularly on x86_64 simulators where the load order differs from arm64. This matches the pattern used by React Native core in RCTViewComponentView.mm (see facebook/react-native#37274). --- ios/Fabric/RNCSafeAreaProviderComponentView.mm | 2 ++ ios/Fabric/RNCSafeAreaViewComponentView.mm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ios/Fabric/RNCSafeAreaProviderComponentView.mm b/ios/Fabric/RNCSafeAreaProviderComponentView.mm index f315ccda..e587a92e 100644 --- a/ios/Fabric/RNCSafeAreaProviderComponentView.mm +++ b/ios/Fabric/RNCSafeAreaProviderComponentView.mm @@ -21,10 +21,12 @@ @implementation RNCSafeAreaProviderComponentView { } // Needed because of this: https://github.com/facebook/react-native/pull/37274 +#ifdef RCT_DYNAMIC_FRAMEWORKS + (void)load { [super load]; } +#endif - (instancetype)initWithFrame:(CGRect)frame { diff --git a/ios/Fabric/RNCSafeAreaViewComponentView.mm b/ios/Fabric/RNCSafeAreaViewComponentView.mm index 827fa4dd..f5cf31df 100644 --- a/ios/Fabric/RNCSafeAreaViewComponentView.mm +++ b/ios/Fabric/RNCSafeAreaViewComponentView.mm @@ -24,10 +24,12 @@ @implementation RNCSafeAreaViewComponentView { } // Needed because of this: https://github.com/facebook/react-native/pull/37274 +#ifdef RCT_DYNAMIC_FRAMEWORKS + (void)load { [super load]; } +#endif - (instancetype)initWithFrame:(CGRect)frame {