react-native: [RN@0.75.2] `yoga/style/Style.h` file not found
Description
Attempting to upgrade my react-native-static-server library from RN@0.74 to RN@0.75.2, building for iOS, new arch, getting the error with yoga:
Interestingly, I’ve already upgraded a couple of other libs the same way, without having this issue.
Steps to reproduce
Clone https://github.com/birdofpreyru/react-native-static-server/commit/6f6c8993ef0e435577ca9dcbf8560acff9c526ea , try to build the Example App in the library codebase (in the /example folder) for iOS.
React Native Version
0.75.2
Affected Platforms
Runtime - iOS, Build - MacOS
Output of npx react-native info
N/A
Stacktrace or Logs
N/A
Reproducer
N/A
Screenshots and Videos
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (17 by maintainers)
Commits related to this issue
- fix: use proper codegen types (#697) ### Summary We were using `type: "all"` in codegenConfig for all types of libraries. @cipolleschi recommended us to use proper types instead [in this thread]... — committed to callstack/react-native-builder-bob by atlj 2 years ago
- update to RN 0.76.3 to fix build error 0.76.2 fixed this error: https://github.com/facebook/react-native/issues/46208 — committed to hannojg/nitro by hannojg 2 years ago
I had the same issue on RN 0.76.1. Adding this to the Podfile fixed the issue for me.
Since it needs the
installervar, it should be inside thepost_install do |installer|block. It worked for me.@atlj Honestly, I’m not sure. The problem was happening in the original issue because the codegen was generating some stuff for components when there were no actual components in the library. In theory that should not be a problem, but practically it was.
I think you can easily reproduce the issue by following the steps above. In general, I’d say that if a user choose to create a TM, it’s better to set the type to
modules. If they chose to build a component, let’s set the type tocomponents.It’s alway better to have less code to build! 😉
We guaranteed Codegen working only for the latest version of React Native as codegen was part of the New Architecture. Now that the new architecture is stable we are going to guarantee that codegen works for versions > 0.76 and in the official support windows. so yeah, technically, yes, libraries depending on older versions of Codegen might not build.