You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error : Use of undeclared identifier 'YGValue' when building iOS #33976
Placed the file in the folder to see if it would build. Even tho i don't have a case sensitive volume, the next error shows up. The file is in the folder:
Also happening in an almost clean project. @JB-CHAUVIN Is this a priority issue? Haven't been able to build in since monday and i'm seeing a lot of related issues when i search. The error exists in Expo 43, 44 and 45 in multiple modules (safe-area-context, webview, Asynstorage).
Reacted by Bardiamist, Alon Ezer, Daniel Abitbul, Istvan Makary, tony chen, anyinfa, Pablo Henrique, Jack Gardner, Serge Morel, Adam Lefaivre and 1 more
Hmm, I too have this error after update to 0.69.0
Nothing helped as clear pods/clean build
But fresh project built successfully
How to update my project, what can be?
Output of npx react-native info
System:
OS: macOS 12.4
CPU: (10) arm64 Apple M1 Max
Memory: 28.07 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.4.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.12.1 - /opt/homebrew/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.0 => 0.69.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
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 : #33648
This really needs a fix tho, many hours lost by a lot of people.
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 to RCTInputAccessoryShadowView.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 from yoga/Yoga.h types and Obj-C is not. Any ideas?
patches/react-native+0.69.0.patch:
diff --git a/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m b/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.mm
similarity index 100%
rename from node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m
rename to node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.mm
diff --git a/node_modules/react-native/Libraries/Text/React-RCTText.podspec b/node_modules/react-native/Libraries/Text/React-RCTText.podspec
index 793a8db..e324b03 100644
--- a/node_modules/react-native/Libraries/Text/React-RCTText.podspec+++ b/node_modules/react-native/Libraries/Text/React-RCTText.podspec@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "12.4" }
s.source = source
- s.source_files = "**/*.{h,m}"+ s.source_files = "**/*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "RCTText"
diff --git a/node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.m b/node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm
similarity index 83%
rename from node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.m
rename to node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm
index 8322bfc..47d6b5a 100644
--- a/node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.m+++ b/node_modules/react-native/Libraries/Text/TextInput/RCTInputAccessoryShadowView.mm@@ -14,7 +14,7 @@ @implementation RCTInputAccessoryShadowView
- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex
{
[super insertReactSubview:subview atIndex:atIndex];
- subview.width = (YGValue) { RCTScreenSize().width, YGUnitPoint };+ subview.width = (YGValue) { static_cast<float>(RCTScreenSize().width), YGUnitPoint };
}
@end
Thanks @ph4r05 this indeed makes the build move forward for me (case-insensitive FS as well).
But it fails a bit later with:
/Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:17:42: error: missing '#include "yoga/Yoga.h"'; 'YGNodeRef' must be declared before it is used
static void RCTInlineViewYogaNodeDirtied(YGNodeRef node)
^
In module 'React' imported from /Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:8:
/Users/renchap/dev/project/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/Yoga.h:34:24: note: declaration here is not visible
typedef struct YGNode* YGNodeRef;
Once this file has been renamed to RCTBaseTextShadowView.mm, it proceeds until:
/Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.m:25:3: error: missing '#include "yoga/YGValue.h"'; 'YGValue' must be declared before it is used
YGValue _paddingMetaProps[META_PROP_COUNT];
^
In module 'React' imported from /Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.h:1:
/Users/renchap/dev/notos/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/YGValue.h:35:3: note: declaration here is not visible
} YGValue;
^
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.
@renchap great it works for you as well! The patch renames RCTBaseTextShadowView.m to RCTBaseTextShadowView.mm too. I edited the original comment to include also patch to react-native-safe-area-context module which was needed on my side as well. But from what I see now, don't we have the same set of changed files?
Thanks @ph4r05 this indeed makes the build move forward for me (case-insensitive FS as well).
But it fails a bit later with:
/Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:17:42: error: missing '#include "yoga/Yoga.h"'; 'YGNodeRef' must be declared before it is used
static void RCTInlineViewYogaNodeDirtied(YGNodeRef node)
^
In module 'React' imported from /Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:8:
/Users/renchap/dev/project/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/Yoga.h:34:24: note: declaration here is not visible
typedef struct YGNode* YGNodeRef;
Once this file has been renamed to RCTBaseTextShadowView.mm, it proceeds until:
/Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.m:25:3: error: missing '#include "yoga/YGValue.h"'; 'YGValue' must be declared before it is used
YGValue _paddingMetaProps[META_PROP_COUNT];
^
In module 'React' imported from /Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.h:1:
/Users/renchap/dev/notos/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/YGValue.h:35:3: note: declaration here is not visible
} YGValue;
^
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.
So I renamed EXUpdatesFileDownloader.m to EXUpdatesFileDownloader.mm
After renaming the affected file in my own case, I am getting an error:
error: Build input file cannot be found: '/Users/username/initialDesktop/RN-select-country/app-name/node_modules/expo-updates/ios/EXUpdates/AppLoader/EXUpdatesFileDownloader.m'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'EXUpdates' from project 'Pods')
Did you run patch-package first before running build iOS command again?
Thanks @ph4r05 this indeed makes the build move forward for me (case-insensitive FS as well).
But it fails a bit later with:
/Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:17:42: error: missing '#include "yoga/Yoga.h"'; 'YGNodeRef' must be declared before it is used
static void RCTInlineViewYogaNodeDirtied(YGNodeRef node)
^
In module 'React' imported from /Users/renchap/dev/project/node_modules/react-native/Libraries/Text/BaseText/RCTBaseTextShadowView.m:8:
/Users/renchap/dev/project/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/Yoga.h:34:24: note: declaration here is not visible
typedef struct YGNode* YGNodeRef;
Once this file has been renamed to RCTBaseTextShadowView.mm, it proceeds until:
/Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.m:25:3: error: missing '#include "yoga/YGValue.h"'; 'YGValue' must be declared before it is used
YGValue _paddingMetaProps[META_PROP_COUNT];
^
In module 'React' imported from /Users/renchap/dev/notos/node_modules/react-native-safe-area-context/ios/RNCSafeAreaShadowView.h:1:
/Users/renchap/dev/notos/packages/mobile/ios/Pods/Headers/Public/Yoga/yoga/YGValue.h:35:3: note: declaration here is not visible
} YGValue;
^
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.
So I renamed EXUpdatesFileDownloader.m to EXUpdatesFileDownloader.mm
After renaming the affected file in my own case, I am getting an error:
error: Build input file cannot be found: '/Users/username/initialDesktop/RN-select-country/app-name/node_modules/expo-updates/ios/EXUpdates/AppLoader/EXUpdatesFileDownloader.m'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'EXUpdates' from project 'Pods')
Did you run patch-package first before running build iOS command again?
I solved the new error by running pod deintegrate, and pod install.
However, this led to more errors in the code after running 'npm run ios' command.
Activity
mfik commentedon Jun 11, 2022
Same!
mfik commentedon Jun 11, 2022
Related #33815
fortmarek commentedon Jun 13, 2022
Hey @JB-CHAUVIN 👋
Would it be possible to add a sample or reproduction steps? The current
0.69.0-rc.6works when using a project created with the RN template.mfik commentedon Jun 13, 2022
The new error is for react-native-webview
Package:
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "expo start --dev-client",
"test": "jest"
},
"dependencies": {
"@config-plugins/react-native-google-cast": "^2.0.0",
"@expo-google-fonts/poppins": "^0.2.2",
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-navigation/drawer": "^6.4.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/native-stack": "^6.6.1",
"@react-navigation/stack": "^6.2.1",
"axios": "^0.21.1",
"expo": "^45.0.5",
"expo-app-loading": "~2.0.0",
"expo-av": "~11.2.3",
"expo-dev-client": "~1.0.0",
"expo-font": "~10.1.0",
"expo-image-loader": "~3.2.0",
"expo-keep-awake": "~10.1.1",
"expo-splash-screen": "~0.15.1",
"expo-status-bar": "~1.3.0",
"expo-updates": "~0.13.2",
"moment": "^2.29.3",
"react": "18.0.0",
"react-dom": "17.0.2",
"react-hook-form": "^6.15.5",
"react-native": "0.69.0-rc.6",
"react-native-gesture-handler": "~2.2.1",
"react-native-google-cast": "^4.2.4",
"react-native-reanimated": "~2.8.0",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-sound-player": "^0.12.0",
"react-native-storage": "^1.0.1",
"react-native-swift": "^1.2.3",
"react-native-track-player": "^2.2.0-rc3",
"react-native-web": "0.17.7",
"react-native-webview": "^11.22.2",
"react-player": "^2.10.0"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~17.0.21",
"@types/react-dom": "~17.0.11",
"@types/react-native": "~0.67.6",
"babel-preset-expo": "~9.1.0",
"jest-expo": "^45.0.0",
"typescript": "~4.3.5"
},
"jest": {
"preset": "react-native"
},
"private": true,
"name": "None",
"version": "1.0.0",
"isSwift": true
}
mfik commentedon Jun 13, 2022
Placed the file in the folder to see if it would build. Even tho i don't have a case sensitive volume, the next error shows up. The file is in the folder:
mfik commentedon Jun 15, 2022
Also happening in an almost clean project. @JB-CHAUVIN Is this a priority issue? Haven't been able to build in since monday and i'm seeing a lot of related issues when i search. The error exists in Expo 43, 44 and 45 in multiple modules (safe-area-context, webview, Asynstorage).
renchap commentedon Jun 21, 2022
I am seeing the same error when updating my app to RN 0.69-rc6:
This seems to be different than #33648 as I dont have a case-sentitive FS (standard macOS APFS).
karatekid430 commentedon Jun 23, 2022
Experiencing this with 0.69.0 release
Bardiamist commentedon Jun 23, 2022
Hmm, I too have this error after update to 0.69.0
Nothing helped as clear pods/clean build
But fresh project built successfully
How to update my project, what can be?
Output of npx react-native info
592da commentedon Jun 23, 2022
Also having this issue after upgrading from 0.68.2 to 0.69
Any suggestions?
zhiqingchen commentedon Jun 23, 2022
same issue
https://github.com/NervJS/taro-native-shell/runs/7024748869?check_suite_focus=true
mfik commentedon Jun 23, 2022
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 : #33648
This really needs a fix tho, many hours lost by a lot of people.
ph4r05 commentedon Jun 23, 2022
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.mtoRCTInputAccessoryShadowView.mmso Obj-C++ is used to compile it.I had to change
node_modules/react-native/Libraries/Text/React-RCTText.podspecso*.mmfiles 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.htypes and Obj-C is not. Any ideas?patches/react-native+0.69.0.patch:I've added my changes to #34064
For completeness, I had to edit also
react-native-safe-area-context:renchap commentedon Jun 24, 2022
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
.mfiles 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.
ph4r05 commentedon Jun 24, 2022
@renchap great it works for you as well! The patch renames
RCTBaseTextShadowView.mtoRCTBaseTextShadowView.mmtoo. I edited the original comment to include also patch toreact-native-safe-area-contextmodule which was needed on my side as well. But from what I see now, don't we have the same set of changed files?renchap commentedon Jun 24, 2022
I missed your
RCTBaseTextShadowView.mrenaming!It now compiles correctly with your 2 patches 🎉
lisong996 commentedon Jun 28, 2022
same question after install expo
fix(build): fixes React-RCTText build with RN 0.69.0 (#34064)
innocodes commentedon Jan 11, 2023
I have a similar issue.
So I renamed EXUpdatesFileDownloader.m to EXUpdatesFileDownloader.mm
After renaming the affected file in my own case, I am getting an error:
error: Build input file cannot be found: '/Users/username/initialDesktop/RN-select-country/app-name/node_modules/expo-updates/ios/EXUpdates/AppLoader/EXUpdatesFileDownloader.m'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'EXUpdates' from project 'Pods')Did you run patch-package first before running build iOS command again?
innocodes commentedon Jan 11, 2023
I solved the new error by running pod deintegrate, and pod install.
However, this led to more errors in the code after running 'npm run ios' command.
Any fix for this yet?
fix(build): fixes React-RCTText build with RN 0.69.0 (#34064)