upgrade-support icon indicating copy to clipboard operation
upgrade-support copied to clipboard

RCTAppDelegate.h file not found after upgrading from 0.70.6 to 0.71.4

Open RSchneider94 opened this issue 2 years ago • 22 comments

Environment

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 164.19 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.1 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm
    Watchman: 2022.10.31.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.0 - /Users/rodrigoschneider/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 31, 33
      Build Tools: 29.0.3, 30.0.3, 31.0.0
      System Images: android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.4 => 0.71.4
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Things I’ve done to figure out my issue

Upgrading version

From 0.70.6 to 0.71.4

Description

After upgrading everything as described in the RN Upgrade Helper Guide, even though I have entirely deleted my node_modules, yarn.lock, cleaned/deleted everything related to the Pods, I'm not able to build successfully my app with the following issue being presented on Xcode:

'RCTAppDelegate.h' file not found

Here is what's inside my AppDelegate.h:

#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : RCTAppDelegate

@end

Reproducible demo

Unfortunately I can't recreate a reproducible demo for this app. Just one thing that might help is that I'm currently using the react-native-firebase lib which asks me to do some changes in some iOS files as described here these are just the difference that my app has regarding the iOS files. Other than that, all looks the same as the Upgrade Guide.

RSchneider94 avatar Mar 27 '23 21:03 RSchneider94

I give a try again following these steps again and using Xcode that build was still failing, but when trying to run directly the react-native run-ios command it has built successfully and worked.

RSchneider94 avatar Mar 30 '23 14:03 RSchneider94

Same here.

carldatu avatar Apr 14 '23 08:04 carldatu

Same issue on M1 !

yshakouri avatar Apr 30 '23 09:04 yshakouri

Anyone found any solution for this?

mdrajibsk8 avatar May 01 '23 19:05 mdrajibsk8

Still looking for a hero with a solution for this on M1 macs

ucheNkadiCode avatar May 05 '23 12:05 ucheNkadiCode

@RSchneider94 would you mind please re-opening this issue and help investigate?

I'm also getting a "react/RCTEventEmitter.h" not found error as well

ucheNkadiCode avatar May 06 '23 08:05 ucheNkadiCode

I manage to solve this issue. What you need to do is simply install react-native manually instead of npm i

Run - npm i react-native@your_verion Also don't forget to clear your cache

mdrajibsk8 avatar May 06 '23 17:05 mdrajibsk8

same issue. "react-native": "^0.71.1", "react-native": "^0.71.7" too,

gezichenshan avatar May 08 '23 10:05 gezichenshan

@RSchneider94 would you mind please re-opening this issue and help investigate?

I'm also getting a "react/RCTEventEmitter.h" not found error as well

sorry, my bad! wasn't suppose to close the issue, just comment, misclick 🙈

RSchneider94 avatar May 08 '23 17:05 RSchneider94

I manage to solve this issue. What you need to do is simply install react-native manually instead of npm i

Run - npm i react-native@your_verion Also don't forget to clear your cache

It didn't resolve the Xcode issue for me. I can launch the app from CLI. Xcode still throws that error. No idea why.

mjstelly avatar May 08 '23 18:05 mjstelly

I threw an answer on StackOverflow, please let me know if it helps you!

https://stackoverflow.com/questions/75822104/rctappdelegate-h-file-not-found/76191070#76191070

ucheNkadiCode avatar May 09 '23 00:05 ucheNkadiCode

Same issue

thanksyouall avatar Jun 14 '23 18:06 thanksyouall

FEEDBACK: I asked our HR to drop the bad old mac and bought a new one, then all issues were resovled magically.

gezichenshan avatar Jun 27 '23 10:06 gezichenshan

Any news? I'm having the same issue since a couple of months with rn 0.71.8

enisinanaj avatar Jun 30 '23 18:06 enisinanaj

For those who still have this issue, first make sure you opened "projectName".xcworkspace and not "projectName".xcodeproj in XCode.

sabeti avatar Jul 05 '23 14:07 sabeti

Any news? I'm having the same issue on M1.

laurensius avatar Sep 08 '23 12:09 laurensius

Any news? I'm having the same issue on M1.

Please check this issue: https://github.com/facebook/react-native/issues/35818

enisinanaj avatar Sep 08 '23 12:09 enisinanaj

Any news? I'm having the same issue on M1.

Please check this issue: facebook/react-native#35818

OK! Thank you!

laurensius avatar Sep 25 '23 08:09 laurensius

Any news? I'm having the same issue on M1.

Hope this helps. https://github.com/facebook/react-native/issues/35818#issuecomment-1736702622

zinzaducnm avatar Sep 27 '23 04:09 zinzaducnm

What worked for me was, in ios/Podfile, add:

target 'YourTargetName' do
    inherit! :complete
  end

Seems like there's an issue with XCode finding the location of RCTAppDelegate.h without it.

liplylie avatar Aug 16 '24 19:08 liplylie