facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.7k stars 24.16k forks source link

RCTAppDelegate.h file not found #36611

Closed griarman closed 10 months ago

griarman commented 1 year ago

Description

I have updated my RN app from 0.70.6 to 0.71.4. The pod install working well. But when I'm trying to run the app it gave me the error saying RCTAppDelegate.h file not found. But I hadn't problems with android running

React Native Version

0.71.4

Output of npx react-native info

System: OS: macOS 13.2.1 CPU: (10) arm64 Apple M1 Max Memory: 732.19 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.1 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.5.0 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.12.0 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /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

Steps to reproduce

just need to run run ios

Snack, code example, screenshot, or link to a repository

Sorry it's a private repo, and I can't share the code with you

konradjurk commented 7 months ago

I resolved it by opening the .xcworkspace file instead of the .xcodeproj. Then, the build was successful.

DeveloperMCD commented 6 months ago

I'm getting the same error -- and I have a brand-new project with only TWO libraries: firebase and Vision Camera. Latest versions all around; this is a test app I've spent a while putting together.

React Native 0.73.4 Vision Camera 3.8.2 React Native Firebase Storage 18.8.0

ildaneta commented 6 months ago

In my case the same error was caused by cocoapods when I updated the version to 1.15.2 so, I installed the version 1.14.2, and I ran:

cd ios
npx po-install

and my problem was solved.

cipolleschi commented 6 months ago

@DeveloperMCD please make sure of:

  1. Run USE_FRAMEWORKS=static bundle exec pod install to install the pods. Firebase requires that specific flag
  2. Open the xcworkspace file, not the xcodeproj file.
ximomompo commented 6 months ago

In my case, after testing all the solutions of this thread, it was uninstalling Xcode and reinstall it. I lost one day of work with this issue.

pavankvch commented 6 months ago

I Found Solution

This problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools when a full regular Xcode was required (happens when CommandLineTools are installed after Xcode)

Solution:

Note: Make sure your Xcode app path is correct.

Xcode: /Applications/Xcode.app/Contents/Developer Xcode-beta: /Applications/Xcode-beta.app/Contents/Developer

U can use command again npm install in ur project & Again pod install

Refer link StackOverFlow : https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error

MaskoMasko commented 4 months ago

I found my solution here: https://github.com/CocoaPods/CocoaPods/issues/9239#issuecomment-557579931 Hope it helps

aneesh-dasari commented 3 months ago

Getting this issue The following build commands failed: CompileC /Users/aneesh/Library/Developer/Xcode/DerivedData/halofi_rn_sb-eovebeieudgfuxakvbnvilzbtryl/Build/Intermediates.noindex/halofi_rn_sb.build/Debug-iphonesimulator/halofi_rn_sb.build/Objects-normal/x86_64/halofi_rn_sb_vers.o /Users/aneesh/Library/Developer/Xcode/DerivedData/halofi_rn_sb-eovebeieudgfuxakvbnvilzbtryl/Build/Intermediates.noindex/halofi_rn_sb.build/Debug-iphonesimulator/halofi_rn_sb.build/DerivedSources/halofi_rn_sb_vers.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'halofi_rn_sb' from project 'halofi_rn_sb') (1 failure)

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

cipolleschi commented 3 months ago

@aneesh-dasari that's not a valuable error message. It only tells us which command failed, but not why. Can you provide a reproducer using this template?

rizbud commented 2 months ago

@DeveloperMCD please make sure of:

  1. Run USE_FRAMEWORKS=static bundle exec pod install to install the pods. Firebase requires that specific flag
  2. Open the xcworkspace file, not the xcodeproj file.

Thanks. Work in my case

itsramiel commented 1 month ago

If after trying all of the above and you are able to run on a real device, but not the simulator; try checking that the project, targets and pods build settings Excluded Architectures - Any iOS Simulator SDK are set to i386. My project build settings had it set to i386, but targets build settings had it set to arm64. I changed it to i386 for all and was able to run on a simulator.

Also you might have this in your Podfile if you are upgrading from an older react native project. This sets it back to arm64 after each pod install. Remove this as well.

installer.pods_project.build_configurations.each do |config|
  config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end

Yes had this left and that was causing it for me. Thank you!

dpencsi commented 1 month ago

For me its simply missing 'arm64' from Pods 'Build settings'. After I install pod that Pod always missing that 'arm64' text Screenshot 2024-07-17 at 21 12 51

This is what you see when you install pod Screenshot 2024-07-17 at 21 04 00

Click on it and you can add it Screenshot 2024-07-17 at 21 04 19

Screenshot 2024-07-17 at 21 08 20

So this is how it should look like the 'arm64' should be in both place the the Debug and the Release Screenshot 2024-07-17 at 21 03 19

I hope this helps, sometimes very little things missing and ruin everything Oh and if you do that the first time you need to do that with the your project I mean above the 'Pods' it should be your project name and add the 'arm64' to your project 'Build settings' as well

liplylie commented 1 week ago

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.