react-native icon indicating copy to clipboard operation
react-native copied to clipboard

0.72.1 -> 'React/RCTAppSetupUtils.h' file not found

Open asjustis opened this issue 1 year ago • 52 comments

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!

Screenshot 2023-07-05 at 13 24 56

asjustis avatar Jul 05 '23 10:07 asjustis

+1

abdi4 avatar Jul 05 '23 17:07 abdi4

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.

canderson402 avatar Jul 05 '23 19:07 canderson402

I double-checked and can confirm I copied everything correctly. Getting rid of that line leads to the other errors. That import is used by Flipper and after stripping it out everything works fine. I'm gona revisit my flipper config might've missed something there

abdi4 avatar Jul 05 '23 21:07 abdi4

I followed the steps in this comment, which solved the issue for me: https://github.com/facebook/react-native/issues/37102#issuecomment-1534841673. Seems like some changes in React-Core aren't being properly ported over when upgrading react-native.

I am now unable to build due to RCTViewComponentView.h not being found instead, but that's another issue (I hope).

helottosornas avatar Jul 06 '23 08:07 helottosornas

+1 having same error after upgrading to 0.72.1

ImReyon avatar Jul 07 '23 14:07 ImReyon

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

MensurRasic avatar Jul 07 '23 14:07 MensurRasic

+1, same problem when upgrade from 0.70.7 -> 0.72.1, hope this can be fixed :(

tranductanz avatar Jul 08 '23 09:07 tranductanz

Same error when upgrading from 0.70.6 to 0.72.1

GaetanFauconnier85 avatar Jul 10 '23 13:07 GaetanFauconnier85

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.

Definitely an idea! I used only npx react-native upgrade for upgrading, but in the Upgrade Helper I can see the AppDelegate.mm indeed was not updated, so maybe the upgrade process silently failed somewhere.

Currently, I just downgraded the RN version and tried to solve the initial problem in a different way, as going through every change and applying it manually seems too much work at this point. Hopefully, we'll get a fix at some point!

asjustis avatar Jul 10 '23 17:07 asjustis

+1 Getting the same error after upgrading to 0.72.2

nishivinodbhatt avatar Jul 10 '23 20:07 nishivinodbhatt

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.

Definitely an idea! I used only npx react-native upgrade for upgrading, but in the Upgrade Helper I can see the AppDelegate.mm indeed was not updated, so maybe the upgrade process silently failed somewhere.

Currently, I just downgraded the RN version and tried to solve the initial problem in a different way, as going through every change and applying it manually seems too much work at this point. Hopefully, we'll get a fix at some point!

I would like to know which version did you downgrade it to? and is it working for you now. Thanks :)

nishivinodbhatt avatar Jul 10 '23 20:07 nishivinodbhatt

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.lock bundle 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

humbertocg avatar Jul 10 '23 23:07 humbertocg

software-mansion/react-native-reanimated#3823 (comment)

Thanks. But sadly did not work for me. Getting the same error

nishivinodbhatt avatar Jul 11 '23 01:07 nishivinodbhatt

software-mansion/react-native-reanimated#3823 (comment)

Thanks. But sadly did not work for me. Getting the same error

try to run the xcode project and compile it to check what errors are happening in the compilation.

I did like this and google each error to see a possible solution.

humbertocg avatar Jul 11 '23 01:07 humbertocg

Same issue after upgrading to 0.72.2. Using Xcode 15 beta, IOS 17.0

gvete avatar Jul 11 '23 12:07 gvete

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.

Definitely an idea! I used only npx react-native upgrade for upgrading, but in the Upgrade Helper I can see the AppDelegate.mm indeed was not updated, so maybe the upgrade process silently failed somewhere. Currently, I just downgraded the RN version and tried to solve the initial problem in a different way, as going through every change and applying it manually seems too much work at this point. Hopefully, we'll get a fix at some point!

I would like to know which version did you downgrade it to? and is it working for you now. Thanks :)

@nishivinodbhatt, I simply reverted to a previous commit in my github project before the update, so it was 0.70.4, also removed node_modules, and in ios dir: Pods/, Podfile.lock and build/. Reinstalled all with yarn install and pod install.

It's working now OK, though I had to first sort out in my ticket mentioned unsupported 12.0 os version issue without upgrading

Hope this helps!

asjustis avatar Jul 11 '23 15:07 asjustis

I also have this problem in version 0.72.3. Does anyone have a solution besides downgrading?

mciechanowicz avatar Jul 14 '23 13:07 mciechanowicz

@mciechanowicz you don't need to downgrade.. just follow the upgrade guide : React Native Upgrade Guide

gvete avatar Jul 14 '23 13:07 gvete

@mciechanowicz you don't need to downgrade.. just follow the upgrade guide : React Native Upgrade Guide

@gvete but does that mean applying each code change manually? I personally am quite reluctant to do that as it is time-consuming, and feels like hardcoding a quick fix for a broken update.

asjustis avatar Jul 19 '23 09:07 asjustis

@mciechanowicz you don't need to downgrade.. just follow the upgrade guide : React Native Upgrade Guide

@gvete but does that mean applying each code change manually? I personally am quite reluctant to do that as it is time-consuming, and feels like hardcoding a quick fix for a broken update.

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.

canderson402 avatar Jul 19 '23 15:07 canderson402

Use instead

#import <RCTAppSetupUtils.h>

oduonye1992 avatar Jul 26 '23 13:07 oduonye1992

Use instead

#import <RCTAppSetupUtils.h>

This solution doesn't work, because a lot of dependencies couldn't be found on RCTAppSetupUtils.h but React/RCTAppSetupUtils.h, Did you do an additional step to get this work?

esvanegas avatar Jul 27 '23 19:07 esvanegas

+1, same problem when upgrade from 0.70.1 -> 0.72.3, Did anyone figure this out?

mxnuchim avatar Jul 28 '23 20:07 mxnuchim

Same here. upgraded from 0.70.6 -> 0.72.3. Any solution?

Dassine avatar Aug 01 '23 19:08 Dassine

Same here. upgraded from 0.70.6 -> 0.72.3. Any solution?

murliswamig avatar Aug 02 '23 12:08 murliswamig

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. image

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)

JunboJ avatar Aug 02 '23 13:08 JunboJ

Use instead

#import <RCTAppSetupUtils.h>

In my case this solved the issue.

To add more details, the project is setup with wix/react-native-navigation. It requires in AppDelegate -> didFinishLaunchingWithOptions to return YES; instead of return [super application:application didFinishLaunchingWithOptions:launchOptions]; When I tried to switch back to return [super application:application didFinishLaunchingWithOptions:launchOptions]; Flipper did see the app without #import <RCTAppSetupUtils.h>, but the app was broken.

serhiy-z-israelit-pro avatar Aug 08 '23 08:08 serhiy-z-israelit-pro

Same problem here! ;-; upgraded from 0.70.5 -> 0.72.3. Any solution?

MaysharaF avatar Aug 10 '23 20:08 MaysharaF

I have also facing the same problem since i have updated(0.70 to 0.72) the project and transfer my project from Intel Mac to Macbook Air M1. Screenshot

MashoodAli-Official avatar Aug 16 '23 09:08 MashoodAli-Official

well, Finally I complete a succesfully upgrade.

the "merging" is not working.

  1. run npx react-native upgrade on your project. (As I mentioned. The merging is not working, so this step right now could be optional. I did just not to lose extra changes)
  2. open helper (verify your previos react native version ) https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.72.4 and change it on dropdown for your "current version"
  3. on "What's your app name?" change into app name (important).
  4. click on "Show me how to upgrade!"
  5. copy and paste or delete acording to the differencies on every file.
  6. Be careful and search on "seach tool" in visual studio code for "RnDiffApp" and change it for your app name. The tool some times did not change for your app name.
  7. On package.json change by hand if you have already added packages for your dependencies (axios, pickers, etc.) or copy and paste the info from helper and reinstall your packages (npm install PACKAGE_NAME for 0.72.4 is not working (no for me), use yarn add PACKAGE_NAME instead)
  8. delete package.lock.json file and node_modules folder.
  9. run npm install
  10. navigate to ios folder and run pod install
  11. finally, run for android and ios to check if everything is ok.

Hope React native team, fix this one, is not clear how to update and the instructions are assuming that you know some steps.

humbertocg avatar Aug 20 '23 03:08 humbertocg