From 1b565f23d4fa9ef88921fa4e51379607f38f0e4a Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Fri, 23 Aug 2024 11:38:25 +0200 Subject: [PATCH] fix: Use `install_modules_dependencies` for React iOS dependencies, fix RN 0.75 new arch (#4040) --- CHANGELOG.md | 6 ++++++ RNSentry.podspec | 37 ++++++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af88e34ba..78c3b02dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Use `install_modules_dependencies` for React iOS dependencies ([#4040](https://github.com/getsentry/sentry-react-native/pull/4040)) + ## 5.30.0 ### Features diff --git a/RNSentry.podspec b/RNSentry.podspec index 7a59f28f5..c5a763f02 100644 --- a/RNSentry.podspec +++ b/RNSentry.podspec @@ -32,25 +32,32 @@ Pod::Spec.new do |s| s.preserve_paths = '*.js' - s.dependency 'React-Core' - s.dependency 'Sentry/HybridSDK', '8.34.0' - s.source_files = 'ios/**/*.{h,m,mm}' s.public_header_files = 'ios/RNSentry.h' s.compiler_flags = other_cflags - # This guard prevent to install the dependencies when we run `pod install` in the old architecture. - if is_new_arch_enabled then - s.pod_target_xcconfig = { - "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", - "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" - } - - s.dependency "React-Codegen" - s.dependency "RCT-Folly" - s.dependency "RCTRequired" - s.dependency "RCTTypeSafety" - s.dependency "ReactCommon/turbomodule/core" + + s.dependency 'Sentry/HybridSDK', '8.34.0' + + if defined? install_modules_dependencies + # Default React Native dependencies for 0.71 and above (new and legacy architecture) + install_modules_dependencies(s) + else + s.dependency 'React-Core' + + if is_new_arch_enabled then + # New Architecture on React Native 0.70 and older + s.pod_target_xcconfig = { + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" + } + + s.dependency "React-Codegen" + s.dependency "RCT-Folly" + s.dependency "RCTRequired" + s.dependency "RCTTypeSafety" + s.dependency "ReactCommon/turbomodule/core" + end end if is_using_hermes then