Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
asjustis opened this issue Jul 5, 2023 · 53 comments
Closed

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

asjustis opened this issue Jul 5, 2023 · 53 comments
Labels
Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Type: Upgrade Issue Issues reported from upgrade issue form

Comments

@asjustis
Copy link

asjustis commented Jul 5, 2023

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: #34106 (comment)

Any help is appreciated!

Screenshot 2023-07-05 at 13 24 56
@asjustis asjustis added Needs: Triage 🔍 Type: Upgrade Issue Issues reported from upgrade issue form labels Jul 5, 2023
@abdi4
Copy link

abdi4 commented Jul 5, 2023

+1

@canderson402
Copy link

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.

@abdi4
Copy link

abdi4 commented Jul 5, 2023

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

@helottosornas
Copy link

I followed the steps in this comment, which solved the issue for me: #37102 (comment). 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).

@ImReyon
Copy link

ImReyon commented Jul 7, 2023

+1 having same error after upgrading to 0.72.1

@MensurRasic
Copy link

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

@tranductanz
Copy link

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

@GaetanFauconnier85
Copy link

Same error when upgrading from 0.70.6 to 0.72.1

@asjustis
Copy link
Author

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!

@nishivinodbhatt
Copy link

+1 Getting the same error after upgrading to 0.72.2

@nishivinodbhatt
Copy link

nishivinodbhatt commented Jul 10, 2023

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 :)

@humbertocg
Copy link

humbertocg commented Jul 10, 2023

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
#36690 (comment)

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

I got a compilation success, but I'm still facing other error. At least it is compiling

@nishivinodbhatt
Copy link

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

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

@humbertocg
Copy link

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.

@gvete
Copy link

gvete commented Jul 11, 2023

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

@asjustis
Copy link
Author

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!

@mciechanowicz
Copy link

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

@gvete
Copy link

gvete commented Jul 14, 2023

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

@asjustis
Copy link
Author

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

@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 19, 2023
@cortinico cortinico removed the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 19, 2023
@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Jul 19, 2023
@canderson402
Copy link

canderson402 commented Jul 19, 2023

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

@oduonye1992
Copy link

Use instead

#import <RCTAppSetupUtils.h>

@esvanegas
Copy link

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?

@mxnuchim
Copy link

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

@Dassine
Copy link

Dassine commented Aug 1, 2023

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

@murliswamig
Copy link

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

@bszyman
Copy link

bszyman commented Sep 25, 2023

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)

Chiming in that this worked for me too.

Apparently when we had done earlier upgrades from 0.69.7, this was overlooked. Cleaning this cruft out fixed the issue.

Get the whole list/diff here: https://react-native-community.github.io/upgrade-helper/?from=0.69.7&to=0.72.4#RnDiffApp-ios-RnDiffApp-AppDelegate.mm

@Darrick-Oliver
Copy link

What worked for me was deleting the ios/ folder that was generated with the old RN version, and re-running npm run ios. This made the correct modifications to the AppDelegate.mm and other files mentioned above.

@dre-on
Copy link

dre-on commented Sep 28, 2023

What worked for me was deleting the ios/ folder that was generated with the old RN version, and re-running npm run ios. This made the correct modifications to the AppDelegate.mm and other files mentioned above.

Thank you, kind sir.

@hassanharoon321
Copy link

no solution still yet

@MendyK
Copy link

MendyK commented Oct 4, 2023

If you are using expo, delete your ios/ folder and run npx expo run:ios

CC @hassanharoon321

@hassanharoon321
Copy link

If you are using expo, delete your ios/ folder and run npx expo run:ios

CC @hassanharoon321

Not using expo I just downgrade version

@MendyK
Copy link

MendyK commented Oct 4, 2023

@hassanharoon321 I'm on react native 0.72.5. Try rerunning the app in the usual way you do after deleting the iOS folder.

@austimkelly
Copy link

Changing from #import <React/RCTAppSetupUtils.h> to #import <RCTAppSetupUtils.h> fixed for me. I'm building with expo, so I had to fix this. Versions:

  • "expo": "^49.0.13",
  • "react-native": "^0.72.5",
  • "react": "18.2.0",

The RCTAppSetUpUtils is under a different project. I'm not sure if that changed during a react native upgrade.

Screenshot 2023-10-06 at 2 35 55 PM

Here's where the <React/*> includes are:
Screenshot 2023-10-06 at 2 36 34 PM

Maybe some include paths are messed up?

@surasit-int-trueid
Copy link

I just changed to new format
#import <React/RCTAppSetupUtils.h>

change to
#import "RCTAppSetupUtils.h"

@SalmanFaris53
Copy link

iam also facing the same issue:-

Screenshot 2024-01-25 at 9 38 37 AM

any one got the solution?

@FladioArmandika
Copy link

after i changed #import <React/RCTAppSetupUtils.h>
into #import "RCTAppSetupUtils.h"

I got another error

/Build/Products/Debug-iphonesimulator/RCT-Folly/folly.framework/Headers/folly/Optional.h:614:10 
'folly/experimental/coro/Coroutine.h' file not found

@JoDerGraf
Copy link

after i changed #import <React/RCTAppSetupUtils.h> into #import "RCTAppSetupUtils.h"

I got another error

/Build/Products/Debug-iphonesimulator/RCT-Folly/folly.framework/Headers/folly/Optional.h:614:10 
'folly/experimental/coro/Coroutine.h' file not found

Have you found a solution for it? I have the same problem.

@rocketraman
Copy link
Contributor

Changing from #import <React/RCTAppSetupUtils.h> to #import <RCTAppSetupUtils.h> fixed for me.

This solves not finding RCTAppSetupUtils, but then for me leads to:

In file included from /.../MyRNProject/AppDelegate.mm:8:
/.../Pods/Headers/Public/React-RCTAppDelegate/RCTAppSetupUtils.h:23:9: fatal error: 'React/JSCExecutorFactory.h' file not found
#import <React/JSCExecutorFactory.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@rocketraman
Copy link
Contributor

rocketraman commented Apr 23, 2024

I can see that React/JSCExecutorFactory.h is not supposed to be included unless hermes is disabled:

https://github.com/facebook/react-native/blob/972b42016ef02dc3cecf9743bad82c9fd2068805/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h#L16C1-L24C21

and that the CxxBridge pod that contains JSCExecutorFactory.h is not included in my Podfile.lock, also presumably because Hermes is now enabled by default.

I can also confirm that by manually deleting the #if USE_HERMES check, and the #else block that loads JSCExecutorFactory.h, the build works. So it seems that the #if USE_HERMES macro is somehow failing to return true for this header file.

@rocketraman
Copy link
Contributor

rocketraman commented Apr 23, 2024

Looking at the output of clang, the parameter passed to compile RCTAppSetupUtils.mm is -DUSE_HERMES, not -DUSE_HERMES\=1 as all the other files.

I'm guessing this is due to this line:

hermes_flag = (use_hermes ? " -DUSE_HERMES" : "")

@hoonjoo-park
Copy link
Contributor

hoonjoo-park commented May 13, 2024

As @rocketraman suggested, it seems like USE_HERMES isn't working properly.
As a workaround, I've done the following below:

  1. Go to the Xcode project's Build Settings.
  2. Find Preprocessor Macros inside Apple Clang - Preprocessing section.
  3. Add USE_HERMES=1 for both Debug and Release configurations.

@SunZhiC
Copy link

SunZhiC commented Jun 5, 2024

iam also facing the same issue:-

Screenshot 2024-01-25 at 9 38 37 AM any one got the solution?

They have changed the default content in AppDelegate.m and AppDeleagate.h file, try to create a new project with react-native 0.72.4, then compare these two new files with old files.

@Ahsanali012
Copy link

Ahsanali012 commented Jun 29, 2024

any fix for this as same error in 0.72.3 project having xcode 15.4??

@Ahsanali012
Copy link

Is this error related to Flipper? I am already installing pod using NO_FLIPPER = 1 pod install

@Ahsanali012
Copy link

npx expo run:ios

Any solution ?

@abhayagrawal-fareye
Copy link

I can see that React/JSCExecutorFactory.h is not supposed to be included unless hermes is disabled:

https://github.com/facebook/react-native/blob/972b42016ef02dc3cecf9743bad82c9fd2068805/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h#L16C1-L24C21

and that the CxxBridge pod that contains JSCExecutorFactory.h is not included in my Podfile.lock, also presumably because Hermes is now enabled by default.

I can also confirm that by manually deleting the #if USE_HERMES check, and the #else block that loads JSCExecutorFactory.h, the build works. So it seems that the #if USE_HERMES macro is somehow failing to return true for this header file.

Is there any fix for it ? I am having the same problem while upgrading to 0.74.5

rocketraman added a commit to rocketraman/react-native that referenced this issue Aug 17, 2024
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES=1`.

Hopefully this will fix facebook#38193.
rocketraman added a commit to rocketraman/react-native that referenced this issue Aug 17, 2024
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix facebook#38193.
rocketraman added a commit to rocketraman/react-native that referenced this issue Aug 17, 2024
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix facebook#38193.
rocketraman added a commit to rocketraman/react-native that referenced this issue Aug 17, 2024
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix facebook#38193.
rocketraman added a commit to rocketraman/react-native that referenced this issue Aug 17, 2024
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix facebook#38193.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Type: Upgrade Issue Issues reported from upgrade issue form
Projects
None yet
Development

Successfully merging a pull request may close this issue.