react-native: Multiple React-Codegen errors
Description
I’m upgrade my RN project to 0.69.2
and got the following errors when compiling:
-
'react/renderer/components/rncore/ShadowNodes.h' file not found 1. Did not find header 'renderer/components/rncore/ShadowNodes.h' in framework 'react' (loaded from '/Users/<user>/Library/Developer/Xcode/DerivedData/ProjectName-fnnixkbsrymrloacnykiaotbdtlb/Build/Products/Debug-iphonesimulator/React-Core')
-
'react/renderer/components/rncore/Props.h' file not found 1. Did not find header 'renderer/components/rncore/Props.h' in framework 'react' (loaded from '/Users/<user>/Library/Developer/Xcode/DerivedData/ProjectName-fnnixkbsrymrloacnykiaotbdtlb/Build/Products/Debug-iphonesimulator/React-Core')
-
'react/renderer/components/rncore/EventEmitters.h' file not found 1. Did not find header 'renderer/components/rncore/EventEmitters.h' in framework 'react' (loaded from '/Users/<user>/Library/Developer/Xcode/DerivedData/ProjectName-fnnixkbsrymrloacnykiaotbdtlb/Build/Products/Debug-iphonesimulator/React-Core')
Version
0.69.2
Output of npx react-native info
System:
OS: macOS 12.4
CPU: (8) arm64 Apple M1 Pro
Memory: 204.66 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.6.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.13.2 - /opt/homebrew/bin/npm
Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
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.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.2 => 0.69.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
Create a new RN project with 0.69.1 or 0.69.2 versions
Snack, code example, screenshot, or link to a repository
Here’s my Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
inhibit_all_warnings! #added to remove unneccesory pods warning
use_frameworks!
install! 'cocoapods',
:deterministic_uuids => false
target 'ProjectName' do
use_modular_headers!
config = use_native_modules!
use_react_native!(:path => config[:reactNativePath], :hermes_enabled => true, :app_path => "#{Pod::Config.instance.installation_root}/..")
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'GoogleSignIn'
pod 'CountryPickerView'
pod 'Alamofire', '~> 4.9.1'
pod 'DeviceKit'
pod 'PhoneNumberKit'
pod 'OneSignal'
pod 'MBProgressHUD'
pod 'Firebase'
pod 'Firebase/Performance'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
pod 'Firebase/Crashlytics'
pod 'Cosmos'
pod 'Branch'
pod 'Stripe'
pod 'Contentful'
pod 'lottie-ios'
pod 'DateToolsSwift'
pod 'GrowingTextView'
pod 'ReachabilitySwift'
pod 'Amplitude-iOS'
pod 'RxSwift'
pod 'RxCocoa'
pod 'DKPhotoGallery'
pod 'SDWebImage', '~> 5.10.4'
pod 'ZendeskSupportSDK'
pod 'GooglePlaces'
pod 'UIScrollView-InfiniteScroll'
pod 'UITextView+Placeholder'
pod 'JWTDecode'
pod 'AppsFlyerFramework'
pod 'IQKeyboardManagerSwift'
pod 'CropViewController'
pod 'TwilioVideo'
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Here’s my package.json:
{
"name": "coreact",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "yarn react-native start",
"android": "yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res --minify",
"run_android_debug": "react-native run-android --variant=debug",
"run_android_release": "react-native run-android --variant=release",
"ios": "react-native run-ios",
"ios-bundle": "yarn react-native bundle --platform ios --entry-file index.js --bundle-output ./ios/assets/RCTBundle/ios.bundle --dev=false --platform='ios' --assets-dest='./ios' --minify",
"test": "jest",
"lint": "eslint .",
"prettier-check": "npx prettier --check 'src/**/*.{ts,tsx,js,json,jsx}'",
"prettier-format": "npx prettier --write 'src/**/*.{ts,tsx,js,json,jsx}'"
},
"dependencies": {
"@react-navigation/native": "5.9.3",
"@react-navigation/stack": "5.14.3",
"@stripe/stripe-react-native": "0.14.0",
"@types/react-native": "0.67.9",
"joi": "17.4.2",
"moment-timezone": "0.5.34",
"patch-package": "6.4.7",
"prop-types": "15.7.2",
"react": "18.0.0",
"react-native": "0.69.2",
"react-native-autolink": "4.0.0",
"react-native-exception-handler": "2.10.10",
"react-native-gesture-handler": "2.4.2",
"react-native-pod": "1.10.3",
"react-native-reanimated": "1.13.3",
"react-native-safe-area-context": "3.3.2",
"react-native-safe-area-view": "1.1.1",
"react-native-screens": "3.10.2",
"react-native-swipe-gestures": "1.0.5",
"resolve-url": "0.2.1"
},
"devDependencies": {
"@babel/core": "7.12.9",
"@babel/runtime": "7.12.5",
"@react-native-community/eslint-config": "2.0.0",
"babel-jest": "26.6.3",
"babel-plugin-module-resolver": "4.1.0",
"eslint": "7.32.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "0.70.3",
"prettier": "2.7.0",
"react-test-renderer": "18.0.0"
},
"jest": {
"preset": "react-native"
}
}
The errors:
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 7
- Comments: 22
Hey so for me the solution was to remove the build folder (not clear build from Xcode but the folder itself), the node_modules folder, Pods folder, package-lock.json, Podfile.lock.
then reinstall everything by doing npm install && cd ./ios && pod install
FYI i got this error after trying to the command line. :
RCT_NEW_ARCH_ENABLED=0 bundle exec pod install
I don’t know it it is related. but now i just tried to not use the new architectureI have the same problem, upgrade to 0.70, works fine on intel MacBook, fails on M1
Thanks a lot this worked for me. I have also tried
RCT_NEW_ARCH_ENABLED=0 bundle exec pod install
, and I guess the reason was this as well.Currently going through this error, been a few hours, really hard to fix when there’s not much information about it
No solution above worked for me, mine looks like related to a library I’m using which I can’t tell which one
my-project/react-native/ios/build/generated/ios/react/renderer/components/safeareacontext/ShadowNodes.cpp:11:10 'react/renderer/components/safeareacontext/ShadowNodes.h' file not found
EDIT 1:
I added
ENV['RCT_NEW_ARCH_ENABLED'] = '0';
on the top of myPodfile
and then did arm -rf Pods Podfile.lock && pod install --repo-update
and suddenly it works, which I find weird because I’ve done the equivalent in the terminal by runningRCT_NEW_ARCH_ENABLED=0 pod install
and it didn’t work. Now I’m not sure about the repercussions of settingENV['RCT_NEW_ARCH_ENABLED'] = '0';
but I didn’t really intend to use the new arch at the moment because support is mostly experimental. Below is the dependencies on mypackage.json
This is not a solution. Of course it’d work if you disable the new architecture.
The error is about codegen issues with the new architecture.
Same issue still in 2024? anyone found a solution?
same here
#include <react/renderer/components/rngesturehandler_codegen/ShadowNodes.h> Error : ‘react/renderer/components/rngesturehandler_codegen/ShadowNodes.h’ file not found