Closed LevRozhkov closed 6 months ago
Are you on the new arch?
https://github.com/th3rdwave/react-native-safe-area-context/pull/473
Are you on the new arch?
473
No, as I mentioned in description, newArchEnabled: false
It wasn't the easiest thing to read 🤣
Make sure you only have one copy of all your RN libraries - e.g. run yarn why react-native-safe-area-context
and check only one entry shows up
In Xcode, click 'Project' and 'Clean Build Folder', then try again
I'll close this issue because there isn't a library issue - but hope this helps anyway
Description
I added React Native 0.73.6 to the project, adjusted podfile, did Codegen and project compiled successfully. But after I added some other dependencies to the package.json file and did same steps - project failed to compile. From what I understood, it is related to react-native-safe-area-context and react-native-screens dependencies. I use latest versions of all dependencies.
I tried to create a new RN project but on clear project I have the same compile issue.
React-RCTFabric compile issue
ld: Undefined symbols: _RNCSafeAreaProviderCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNCSafeAreaViewCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNCViewPagerCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNGestureHandlerButtonCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNGestureHandlerRootViewCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSFullWindowOverlayCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenContainerCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenNavigationContainerCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenStackCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenStackHeaderConfigCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSScreenStackHeaderSubviewCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o _RNSSearchBarCls, referenced from: _RCTThirdPartyFabricComponentsProvider in RCTThirdPartyFabricComponentsProvider.o clang: error: linker command failed with exit code 1 (use -v to see invocation)
My package.json dependencies:
"dependencies": { "@babel/core": "^7.24.0", "@babel/preset-env": "^7.24.0", "@react-native/metro-config": "^0.75.0-main", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/core": "^6.4.16", "@react-navigation/drawer": "^6.6.15", "@react-navigation/elements": "^1.3.30", "@react-navigation/material-bottom-tabs": "^6.2.28", "@react-navigation/material-top-tabs": "^6.6.13", "@react-navigation/native": "^6.1.17", "@react-navigation/native-stack": "^6.9.26", "@react-navigation/routers": "^6.1.9", "@react-navigation/stack": "^6.3.29", "@types/react": "^18.2.67", "react": "^18.2.0", "react-native": "^0.73.6", "react-native-gesture-handler": "^2.15.0", "react-native-pager-view": "^6.2.3", "react-native-paper": "^5.12.3", "react-native-reanimated": "^3.8.1", "react-native-safe-area-context": "^4.9.0", "react-native-screens": "^3.29.0", "react-native-tab-view": "^3.5.2", "react-native-vector-icons": "^10.0.3", "typescript": "^5.4.2" }
My podfile:
`require Pod::Executable.execute_command('node', ['-p', 'require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )', dir]).strip
platform :ios, min_ios_version_supported prepare_react_native_project!
use_frameworks!
def __apply_Xcode_14_3_RC_post_install_workaround(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| current_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] minimum_target = min_ios_version_supported if current_target.to_f < minimum_target.to_f config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = minimum_target end end end end
def __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' end end
sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h
enddef pods
my pods
end
config = use_native_modules! use_react_native!( :path => config[:reactNativePath],
An absolute path to your application root.
)
target 'MyApp' do pods end pre_install do |installer| installer.pod_targets.each do |pod| if ['RNScreens', 'RNReanimated'].include? pod.name def pod.build_type Pod::BuildType.static_library end end end end
post_install do |installer| react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false,
:ccache_enabled => true
end `
I tried to add everything as static libraries(use_framework with static linkage) but this didn't help
Output of
npx react-native info
Steps to reproduce
Snack or a link to a repository
https://github.com/LevRozhkov/react-fabric-issue-repro
react-native-safe-area-context version
4.9.0
React Native version
0.73.6
Platforms
iOS