react-native: Error : Use of undeclared identifier 'YGValue' when building iOS
Description
Hello,
I have the following error when building with the latest RN version.
I was just trying to upgrade…
Error : Use of undeclared identifier 'YGValue' when building iOS
Version
0.69-RC.6
Output of npx react-native info
System: OS: macOS 12.2.1 CPU: (10) x64 Apple M1 Pro Memory: 1.71 GB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.19.1 - /usr/local/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 6.14.16 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8309675 Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.0-rc.6 => 0.69.0-rc.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
I tried to upgrade…
Snack, code example, screenshot, or link to a repository
N/A
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 19 (4 by maintainers)
Experiencing this with 0.69.0 release
So this has to do with case sensitive file systems. My drive says it isn’t, but i believe it was encrypted in the past. The temporary solution is to add this step to the build process, as mentioned : https://github.com/facebook/react-native/issues/33648
This really needs a fix tho, many hours lost by a lot of people.
I missed your
RCTBaseTextShadowView.m
renaming!It now compiles correctly with your 2 patches 🎉
I have the same problem but @mfik’s workaround is not working for me.
For some reason, the type error is fixed when I rename
RCTInputAccessoryShadowView.m
toRCTInputAccessoryShadowView.mm
so Obj-C++ is used to compile it.I had to change
node_modules/react-native/Libraries/Text/React-RCTText.podspec
so*.mm
files are taken into account. After reinstalling pods, type error is fixed. I don’t have case-sensitive FS. I am currently investigating why Obj-C++ is able to correctly see types fromyoga/Yoga.h
types and Obj-C is not. Any ideas?patches/react-native+0.69.0.patch
:I’ve added my changes to https://github.com/facebook/react-native/pull/34064
For completeness, I had to edit also
react-native-safe-area-context
:Thanks @ph4r05 this indeed makes the build move forward for me (case-insensitive FS as well).
But it fails a bit later with:
Once this file has been renamed to
RCTBaseTextShadowView.mm
, it proceeds until:It seems to be the same kind of error. Might it be that those
.m
files are included by libraries, but somehow are no longer correctly picked up by the build system?This would explain why it does not happen on a newly created app, and I am hitting more of those than you.