react-native-safe-area-context
react-native-safe-area-context copied to clipboard
Support use_frameworks!
Hi,
we are using RN 0.72 with new architecture and we've tried to use use_frameworks! :linkage => static to upgrade our dependency of Firebase. However after doing that compilation of react-native-safe-area-context fails due to missing header files.
I'm trying to fix the issues by modifying spec via Podfile:
if target.name == "react-native-safe-area-context" then
target.build_configurations.each do |config|
header_search = {"HEADER_SEARCH_PATHS" => [
"$(PODS_TARGET_SRCROOT)/common/cpp/",
"$(PODS_ROOT)/Headers/Public/hermes-engine/",
"$(PODS_ROOT)/Headers/Public/RCTRequired/",
"$(PODS_ROOT)/Headers/Public/FBLazyVector/",
"$(PODS_ROOT)/Headers/Public/React-callinvoker/",
"$(PODS_ROOT)/RCT-Folly/",
"$(PODS_ROOT)/boost/",
"$(PODS_ROOT)/DoubleConversion/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-NativeModulesApple/React_NativeModulesApple.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-Codegen/React_Codegen.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-Fabric/React_Fabric.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-utils/React_utils.framework/Headers/",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-RCTFabric/RCTFabric.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers",
"$(PODS_CONFIGURATION_BUILD_DIR)/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios/",
"$(PODS_CONFIGURATION_BUILD_DIR)/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
]}
config.build_settings.merge!(header_search)
end
end
but I wonder if there is a better way to support static frameworks than this
I don’t think any of the maintainers are likely to pick this up, but we will review and merge PRs if you want to submit one
Have you tried 4.7.0? I updated the way we setup the pod for new arch so I'm hoping this will fix those issues.
Yes, I did but that didn't help.
Unfortunately I don't know iOS ecosystem well enough to understand exactly what use_frameworks! does and why suddenly so many header files cannot be found, but the modification applied in post_install of my Podfile allowed me to compile our app for iOS
need to add
s.pod_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' =>
in podpec file
and replace header imports with named ones