From 6bb75c7b133c9be5f613c3310aa918e5a28cec7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Mon, 24 Jun 2024 03:14:55 -0700 Subject: [PATCH] fix: set proper framework dependencies for built-in pods (#45104) Summary: Platforms like visionOS require explicit framework dependencies to be set in pods to build properly. For some reason linking on visionOS is more strict than on iOS but this might change in some future OS versions so it's good to have pods having exact dependencies. I've discussed that earlier with Saadnajmi and cipolleschi. Let me know if you are okay with this change. ## Changelog: [IOS] [FIXED] - set proper framework dependencies for built-in pods Pull Request resolved: https://github.com/facebook/react-native/pull/45104 Test Plan: CI Green Reviewed By: dmytrorykun Differential Revision: D58943593 Pulled By: cipolleschi fbshipit-source-id: 3d2df4f3bbdf36704e09f5e39bfb838b2e0f3c99 --- packages/react-native/Libraries/Image/React-RCTImage.podspec | 2 +- .../react-native/Libraries/LinkingIOS/React-RCTLinking.podspec | 1 + .../Libraries/NativeAnimation/React-RCTAnimation.podspec | 1 + .../PushNotificationIOS/React-RCTPushNotification.podspec | 2 +- .../react/nativemodule/samples/ReactCommon-Samples.podspec | 2 ++ .../ReactCommon/react/renderer/graphics/React-graphics.podspec | 1 + .../rn-tester/NativeModuleExample/ScreenshotManager.podspec | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Image/React-RCTImage.podspec b/packages/react-native/Libraries/Image/React-RCTImage.podspec index 5aacf0d7999..8f77a54b237 100644 --- a/packages/react-native/Libraries/Image/React-RCTImage.podspec +++ b/packages/react-native/Libraries/Image/React-RCTImage.podspec @@ -45,7 +45,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } - s.framework = ["Accelerate", "UIKit"] + s.framework = ["Accelerate", "UIKit", "QuartzCore", "ImageIO", "CoreGraphics"] s.dependency "RCT-Folly", folly_version s.dependency "RCTTypeSafety" diff --git a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec index eff125c9615..a0c4e1a5b74 100644 --- a/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec +++ b/packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec @@ -44,6 +44,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } + s.framework = "UIKit" s.dependency "React-Core/RCTLinkingHeaders", version s.dependency "ReactCommon/turbomodule/core", version diff --git a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec index c9f32c9eea7..259790ed4e2 100644 --- a/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec +++ b/packages/react-native/Libraries/NativeAnimation/React-RCTAnimation.podspec @@ -43,6 +43,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(" ") } + s.framework = ["UIKit", "QuartzCore"] s.dependency "RCT-Folly", folly_version s.dependency "RCTTypeSafety" diff --git a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec index 7a82e20d911..6f274ca83d4 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +++ b/packages/react-native/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "HEADER_SEARCH_PATHS" => header_search_paths.join(' ') } - s.framework = "UserNotifications" + s.framework = ["UIKit", "UserNotifications"] s.dependency "RCTTypeSafety" s.dependency "React-Core/RCTPushNotificationHeaders" diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec index 5c6fc31aa53..e88b986d6e6 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec @@ -49,6 +49,8 @@ Pod::Spec.new do |s| "USE_HEADERMAP" => "YES", "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", "GCC_WARN_PEDANTIC" => "YES" } + s.framework = "UIKit" + if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' end diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec index 94743610da2..9125fddb886 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -47,6 +47,7 @@ Pod::Spec.new do |s| "platform/cxx", "platform/windows", s.header_dir = "react/renderer/graphics" + s.framework = "UIKit" if ENV['USE_FRAMEWORKS'] s.module_name = "React_graphics" diff --git a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec index 17daaf5934d..3177cf590fe 100644 --- a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec +++ b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec @@ -21,6 +21,7 @@ Pod::Spec.new do |s| s.source_files = "**/*.{h,m,mm,swift}" s.requires_arc = true + s.framework = ["UIKit", "CoreGraphics"] install_modules_dependencies(s) end