React-native: xCode React (missing)

Created on 1 Oct 2019  Â·  25Comments  Â·  Source: facebook/react-native

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

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>
Bug

Most helpful comment

To sum up,
If you're upgrading to [email protected], 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
  1. 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
  2. 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
  3. 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

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

  5. If the issue still exists, it's might be the library *.podspec or sth else, you need to investigate further.
  6. 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

All 25 comments

Did you upgrade or create a new app? If you have upgraded you need to update your Podfile and run pod install

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

no luck, something to do with this.

../../react-native/React/Base/RCTBridgeModule.h:10:9: fatal error: 'React/RCTDefines.h' file not found

import

Did you add React to your podfile ?

pod 'React', :path => '../node_modules/react-native/'

@broros probably, I don't know

If you belevie this is an issue within React Native I will reopen this.

This issue is related to missing React scheme #25838

Same issue, some solution?

I'm also having this issue. Any update?

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)

React Native 0.61 doesn't have React.xcodeproj, but library imports are still looking up to it, it's not a recommended solution but i just downgraded my react-native version at package.json from 0.61.5 to 0.60.0

similar issue: https://github.com/facebook/react-native/issues/25838

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

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.

@JakeHadley Weird ! you shouldn't have to chose between those. In my case, I have "React" as a target (with the bullseye icon) in this list

Same issue... there is no "React" in edit scheme and React is missing...

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

Same issue, have no React library appear in this list like for @JakeHadley. please advise

I ended up making a while new project. I couldn't get it to work.

I also created a new project and copied all my code thier.

On Mon, Jan 6, 2020 at 1:58 PM JakeHadley notifications@github.com wrote:

I ended up making a while new project. I couldn't get it to work.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/26665?email_source=notifications&email_token=AI2HKUS2LXUBQIUKGEOGSL3Q4LTSNA5CNFSM4I4FNZ4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIEYTUA#issuecomment-571050448,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AI2HKUVJVVDPZOQSN3K65MDQ4LTSNANCNFSM4I4FNZ4A
.

To sum up,
If you're upgrading to [email protected], 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
  1. 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
  2. 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
  3. 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

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

  5. If the issue still exists, it's might be the library *.podspec or sth else, you need to investigate further.
  6. 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

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

I have React with concentric circles, not a React shape of house.

If I add this does it works for me?
Screenshot 2020-06-08 at 3 12 10 PM

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

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

Was this page helpful?
0 / 5 - 0 ratings