Open RSchneider94 opened 1 year ago
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.
Same here.
Same issue on M1 !
Anyone found any solution for this?
Still looking for a hero with a solution for this on M1 macs
@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
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
same issue. "react-native": "^0.71.1", "react-native": "^0.71.7" too,
@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 🙈
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.
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
Same issue
FEEDBACK: I asked our HR to drop the bad old mac and bought a new one, then all issues were resovled magically.
Any news? I'm having the same issue since a couple of months with rn 0.71.8
For those who still have this issue, first make sure you opened "projectName".xcworkspace and not "projectName".xcodeproj in XCode.
Any news? I'm having the same issue on M1.
Any news? I'm having the same issue on M1.
Please check this issue: https://github.com/facebook/react-native/issues/35818
Any news? I'm having the same issue on M1.
Please check this issue: facebook/react-native#35818
OK! Thank you!
Any news? I'm having the same issue on M1.
Hope this helps. https://github.com/facebook/react-native/issues/35818#issuecomment-1736702622
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.
FEEDBACK: I asked our HR to drop the bad old mac and bought a new one, then all issues were resovled magically.
Asked HR for a new laptop. They told me to go to the IT department...
Hi everyone! I think i've found one more potential solution for those facing the "RCTAppDelegate.h file not found" error while working on an M1 Mac.
If you've been using an M1 Mac (arm64)
and have recently enabled Rosetta (x86_64)
once for your terminal (e.g., in VSCode), switching back to the native terminal (arm64)
may resolve the issue. I guess this error often occurs due to mismatched dependencies—those installed under Rosetta may conflict with those configured in the native environment.
(e.g., arm64-installed ruby, cocoapods, or rbenv caused conflicts when used with Rosetta for pod installation)
Disable Rosetta for VSCode:
Finder
window, go to Applications, right-click on the VSCode
app icon, select Get Info
, and uncheck Open using Rosetta
.Clean Build:
I ran the following script in the ios
directory of the React Native project:
#!/bin/bash
# clean builds and caches
sudo rm -rf build
sudo rm -rf ~/Library/Developer/Xcode/DerivedData
sudo rm -f Gemfile.lock
gem cleanup
sudo rm -rf Pods/ Podfile.lock
pod cache clean --all
# install and bundle new builds
gem update --system
bundle install --force --clean
pod install --clean-install
➡️ Static Library(libPods-[YourProjectName].a
) Generated!
Revert Frameworks:
Pods-[YourProjectName].framework
with the static library libPods-[YourProjectName].a
.[CP] Copy Pods Resources
if there are scripts generating Pods-[YourProjectName].framework
related config or files.This method worked for me, enabling iOS build immediately after this step.
This issue occurred after integrating Firebase App Distribution via Fastlane and enabling Rosetta for VSCode.
The dynamic Pods-[YourProjectName].framework
replaced the static libPods.a
, leading to build failures.
Reverting to the native environment and performing a clean build resolved the issue.
I tried using dynamic symbolic links and explored several other potential solutions, but modifying the Podfile didn’t resolve the issue in my case.
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
# Define the iOS platform and minimum version
platform :ios, min_ios_version_supported
prepare_react_native_project!
# Check and configure framework linkage
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
# Define the target for the React Native app
target 'reactCapsone' do
config = use_native_modules!
# React Native basic settings
use_react_native!(
:path => config[:reactNativePath],
:app_path => "#{Pod::Config.instance.installation_root}/..",
:hermes_enabled => false, # Disable Hermes
:fabric_enabled => false # Disable Fabric
)
# Post-install configuration
post_install do |installer|
# React Native post-install settings
react_native_post_install(installer, :ccache_enabled => true)
end
end
For Firebase, I only used the Fastlane CI plugin (gem 'fastlane-plugin-firebase_app_distribution'
in ios/fastlane/Pluginfile
). I later removed it and replaced the firebase_app_distribution()
command with a direct Firebase CLI
call in a sh()
block, which resolved my issue. While I’m unsure of Firebase's direct impact on the problem, switching to Rosetta likely stemmed from the Firebase installation.
If Rosetta is required, I recommend reinstalling all related dependencies in the new architecture. Instead of continuing with a project initially created under the arm64 environment, consider setting up a fresh project specifically for Rosetta to avoid potential conflicts.
Some related discussions about M1, Rosetta, and Firebase:
I hope this helps! If you have any questions or alternative solutions, feel free to share. 😊
Environment
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
: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.