react-native: xCode React (missing)

the new version of react native is giving me errors… when I check xCode edit scheme, I get React (missing)

Screenshot 2019-09-30 at 10 56 44 PM

React Native version: 0.61.1

Steps To Reproduce

  1. react-native run-ios

Describe what you expected to happen:

build ios emulator

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

fatal error: 'React/RCTDefines.h' file not found
#import <React/RCTDefines.h>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 23
  • Comments: 27 (3 by maintainers)

Most upvoted comments

To sum up, If you’re upgrading to react-native@0.61.x, you got xCode React(missing), you got ‘React/RCTmodule_name.h’ file not found

You should step by step to prevent redundant actions:

  1. Check if XCode > Product > Schema > Edit Schema > Build has React(missing) or not

    • If React is present, then you continue to check header search path
    • If React is missing, try to delete it then add it back by pressing Plus sign
      • If you cannot found React in Pods > React after click plus sign. Please check your pod file if someone remove pod 'React', :path => '../node_modules/react-native/' from Pod, or they use target.remove_from_project to remove it on post_install
  2. Look at your project dir > Libraries: Depend on your library, some libraries were auto-linked so you don’t need it here anymore, it causes React/RCT*.h not found. Trying to read the latest installation guide and you might remove it (not for all library, just some): image

  3. If the issue still exists, re-check your Pod file, some npm packages already did auto-linking if it has .podspec file in node_modules/foo/bar.podspec ==> Remove the package that supports auto-linking from Pod file

  4. If the issue still exists, ensure to load your package only ONCE, via one of those methods: [project dir > Libraries, Pod file, auto-linking] Normally, you can read the installation guide once more

  5. If the issue still exists, Check headers search path if you’re using manual-linking method: https://github.com/joltup/rn-fetch-blob/issues/461#issuecomment-553355501

    FYI, $(SRCROOT)/../../react-native mean /path/to/node_modules/your_module/ios/../../react-native

  6. You might try to use manual-linking instead of auto-linking for some incompatible library, this is how to disable auto-linking for some specific library: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

  7. If the issue still exists, it’s might be the library *.podspec or sth else, you need to investigate further.

  8. If you write own your library, use __has_include

#if __has_include(<React/RCTDefines.h>)
  #import <React/RCTDefines.h>
#else
  #import "RCTDefines.h"
#endif

Remember to do yarn install, pod install, clean Derival Data, clean Build if needed.

That’s how I solve the issue, do not mess your problem up

@Alaa-Ben With RN 0.61.4 there is no just ‘React’ from the pods section to add on mine… Screen Shot 2019-12-13 at 9 52 10 AM Which one would you recommend?

+1, If you have upgraded, you need to cd ios && pod install. Then go to the same screen (scheme/build), Delete the React (missing), click on the + on the bottom left, add React (from pods section). Finally, check all the checkboxes and place React at the top of the list.

Same issue… there is no “React” in edit scheme and React is missing…

Screen Shot 2019-12-26 at 9 38 59 PM

no luck, something to do with this.

…/…/react-native/React/Base/RCTBridgeModule.h:10:9: fatal error: ‘React/RCTDefines.h’ file not found #import <React/RCTDefines.h>

i fixed this issue by going System Preferences -> Security & Privacy . under privacy tab allow xcode accessing my files and folders.

what actually happen is i upgrade my os to Catalina. somehow the access to files and folder right is not granted to xcode, hence xcode is not able to read the file and having this issue. hope it help.

Screenshot 2020-01-08 at 2 36 11 pm

This issue is related to missing React scheme #25838

I also have the same issue after upgrading react-native. Any quick solution for this?

Could not find the following native modules: react-native-orientation, RNSVG, rn-fetch-blob. Did you forget to run “pod install” ? (It shows all my third party packages)

@nihp I’m in the same case, if you have an answer I would love to ear it 🤗

It worked for me in the latest RN version.

Here is what worked for me:

  1. First make sure that your Podfile is same as the latest Podfile found here: https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5
  2. close xcode.
  3. do the cd ios/ && pod install
  4. see if you can find the React in the pods installed.

I’m also having this issue. Any update?