react-native-screens: [RN 0.75 new arch] 'utils/RectUtil.h' file not found
Description
Hi team,
I’ve been testing upgrading RN 0.74 to 0.75-RC7 with basic stack including react-navigation and react-native-screens.
The iOS build fails for me with the following error:
In file included from /Users/jkosecki/repos/custom/ReactNativeUpgradeTester/node_modules/react-native-screens/ios/RNSScreen.mm:15:
/Users/jkosecki/repos/custom/ReactNativeUpgradeTester/node_modules/react-native-screens/common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h:10:10: fatal error: 'utils/RectUtil.h' file not found
#include "utils/RectUtil.h"
I have applied the following patch locally (included in the reproduction repo):
diff --git a/node_modules/react-native-screens/RNScreens.podspec b/node_modules/react-native-screens/RNScreens.podspec
index be7cc24..14cd2e4 100644
--- a/node_modules/react-native-screens/RNScreens.podspec
+++ b/node_modules/react-native-screens/RNScreens.podspec
@@ -27,7 +27,7 @@ Pod::Spec.new do |s|
s.subspec "common" do |ss|
ss.source_files = ["common/cpp/**/*.{cpp,h}", "cpp/**/*.{cpp,h}"]
ss.header_dir = "rnscreens"
- ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\"" }
+ ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp/react/renderer/components/\"" }
end
end
but I’m not sure if that’s correct way to fix this issue.
Steps to reproduce
- Remove
patches/react-native-screens+3.34.0.patch - Run
yarn setup && yarn ios
Snack or a link to a repository
https://github.com/jankosecki/react-native-upgrade-tester/tree/rn-0.75
Screens version
3.34.0
React Native version
0.75-RC7
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
None
Device model
No response
Acknowledgements
Yes
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 31 (10 by maintainers)
Commits related to this issue
- fix(iOS): Change import of RectUtil.h file to react/renderer/components (#2319) ## Description In the newest version of screens, there's a bug where compiler can't find RectUtil.h file from `util... — committed to software-mansion/react-native-screens by tboba 2 years ago
- fix(iOS): Change import of RectUtil.h file to react/renderer/components (#2319) ## Description In the newest version of screens, there's a bug where compiler can't find RectUtil.h file from `util... — committed to WiseOwlTech/react-native-screens by tboba 2 years ago
- fix(iOS): Change import of RectUtil.h file to react/renderer/components (#2319) ## Description In the newest version of screens, there's a bug where compiler can't find RectUtil.h file from `util... — committed to software-mansion/react-native-screens by tboba 2 years ago
- fix(iOS): Change import of RectUtil.h file to react/renderer/components (#2319) ## Description In the newest version of screens, there's a bug where compiler can't find RectUtil.h file from `utils/R... — committed to software-mansion/react-native-screens by tboba 2 years ago
Any plans to release this change?
This is also happening in 0.75.2. Seems like there is something wrong with the pod installation in 75.
I tried this patch but it didn’t work. (Fixed the issue but other errors started to come up)
With that being said, there is something wrong with the headers linking.
New arch is turned on.
#include <react/renderer/components/rnscreens/utils/RectUtil.h>instead of#include "utils/RectUtil.h"seems to work in my setups.I already released 4.8.0 with patch
@tboba I can reproduce the issues using provided repo. I did the following steps:
patches/react-native-screens+3.34.0.patchyarn setup(it invokes"pod-install": "(cd ./ios ; RCT_NEW_ARCH_ENABLED=1 USE_FRAMEWORKS=static bundle exec pod install --repo-update)"which enables new architecture)Noneteam in Signing & Capabilities)yarn startyarn iosor trigger build from XCode (yarn ioscauses a massive error output with different “error” lines but XCode offers a clear reason:Still happening with version 4.7.0 released yesterday… RN 0.77.1
This is still happening in RN 0.76.0 with “react-native-screens”: “^3.34.0”. I was able to build ios after the below fix
Confirmed, it works!
I had the same issue with RN 0.77.0.
I was able to resolve it by removing the line
#include "utils/RectUtil.h"and updating react-native-screens v4.7.0@kkafar, this is back with RN 0.77.1 (not happening in 0.77.0).
It’s working well after upgraded this package from
3.34.0to latest 4.3.0.I’m using
"react-native": "0.75.3"@matinzd Nope, it shouldn’t. C++ layer is being built only on new architecture, so the old arch should work well 👍
Should I open a PR for that?Is that gonna break paper builds?@matinzd this patch sounds better. Thanks!
Can reproduce on RN 0.75.2. Using this patch seems to fix it.
@matinzd Could you highlight what are the other errors that were introduced, I don’t use this library directly but through “react-navigation” and I don’t face any other issues/errors.