react-native: 0.72.1 -> 'React/RCTAppSetupUtils.h' file not found
New Version
0.72.1
Old Version
0.70.4
Build Target(s)
iOS 16.5 for both device and simulator
Output of react-native info
System: OS: macOS 13.4.1 CPU: (10) arm64 Apple M2 Pro Memory: 1.64 GB / 32.00 GB Shell: version: “5.9” path: /bin/zsh Binaries: Node: version: 20.3.1 path: /opt/homebrew/bin/node Yarn: version: 1.22.19 path: /opt/homebrew/bin/yarn npm: version: 9.6.7 path: /opt/homebrew/bin/npm Watchman: version: 2023.07.03.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.12.1 path: /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 22.4 - iOS 16.4 - macOS 13.3 - tvOS 16.4 - watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: version: 14.3.1/14E300c path: /usr/bin/xcodebuild Languages: Java: Not Found Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: “@react-native-community/cli”: Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.1 wanted: 0.72.1 react-native-macos: Not Found npmGlobalPackages: “react-native”: Not Found Android: hermesEnabled: false newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
Issue and Reproduction Steps
Trying to run the project on a new Macbook Pro M2. Project fails both with yarn run ios
and running ‘play’ straight from XCode.
Got into it after trying to resolve another issue (in the link) using this solution: https://github.com/facebook/react-native/issues/34106#issuecomment-1524819646
Any help is appreciated!
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 26
- Comments: 47
Use instead
#import <RCTAppSetupUtils.h>
Same issue on my side, upgraded from 0.69.1 to 0.72.1 and I am facing the same error :
'React/RCTAppSetupUtils.h' file not found
Using Mac M1
If you are using expo, delete your
ios/
folder and runnpx expo run:ios
CC @hassanharoon321
facing the same issue.
Update
I fixed by running this commands and following the comments on other issues.
I ran this on project root and ios folder:
bundle install
bundle exec pod repo update
delete the ios/Podfile.lockbundle exec pod install
Then https://github.com/facebook/react-native/issues/36690#issuecomment-1493765601
Finally https://github.com/software-mansion/react-native-reanimated/issues/3823#issuecomment-1346687536
I got a compilation success, but I’m still facing other error. At least it is compiling
It helped me! Thanks a lot. 💪
I firstly ran the
npx react-native upgrade
, it will automatically apply as many changes as it can. Then I applied the changes shown in upgrade helper for AppDelegate.mm and AppDelegate.h file. I can see the#import <React/RCTAppSetupUtils.h>
line here has been removed along with many other things.Upgrade helper - https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.72.3 (Remember to change the from/to version)
This solves not finding
RCTAppSetupUtils
, but then for me leads to:I was running into this same issue after upgrading, did you use the upgrade helper? I did, but missed some needed changes. I ended up going through the list again copying each and every file to upgrade properly, here are the versions I went from and to. Upgrade Link
It appears that RCTAppSetupUtils is no longer used in this context, my AppDelegate.mm has no reference to it now.
I just changed to new format #import <React/RCTAppSetupUtils.h>
change to #import “RCTAppSetupUtils.h”
What worked for me was deleting the
ios/
folder that was generated with the old RN version, and re-runningnpm run ios
. This made the correct modifications to theAppDelegate.mm
and other files mentioned above.well, Finally I complete a succesfully upgrade.
the “merging” is not working.
Hope React native team, fix this one, is not clear how to update and the instructions are assuming that you know some steps.
Same here. upgraded from 0.70.6 -> 0.72.3. Any solution?
It only takes like 30-60 minutes if that, much shorter if you are not that behind on versions, and the changes are required for future upgrades anyways so unless you never want to upgrade you will have to do it eventually.