Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xCode React (missing) #26665

Closed
ghost opened this issue Oct 1, 2019 · 27 comments
Closed

xCode React (missing) #26665

ghost opened this issue Oct 1, 2019 · 27 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@ghost
Copy link

ghost commented Oct 1, 2019

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>
@ghost ghost added the Bug label Oct 1, 2019
@radko93
Copy link
Contributor

radko93 commented Oct 1, 2019

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

@Alaa-Ben
Copy link

Alaa-Ben commented Oct 1, 2019

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

@ghost
Copy link
Author

ghost commented Oct 1, 2019

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>

@Alaa-Ben
Copy link

Alaa-Ben commented Oct 1, 2019

Did you add React to your podfile ?

@ghost
Copy link
Author

ghost commented Oct 1, 2019

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

@ghost
Copy link
Author

ghost commented Oct 1, 2019

@radko93
Copy link
Contributor

radko93 commented Oct 1, 2019

@broros probably, I don't know

@radko93
Copy link
Contributor

radko93 commented Oct 1, 2019

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

@radko93 radko93 closed this as completed Oct 1, 2019
@ziyoshams
Copy link

This issue is related to missing React scheme #25838

@eddskt
Copy link

eddskt commented Oct 28, 2019

Same issue, some solution?

@austinthetaco
Copy link

I'm also having this issue. Any update?

@nihp
Copy link

nihp commented Nov 23, 2019

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)

@pedromelo98
Copy link

pedromelo98 commented Nov 26, 2019

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: #25838

@JakeHadley
Copy link

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

@Farhadkm
Copy link

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.

@Alaa-Ben
Copy link

@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

@lenichols
Copy link

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

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

@lisichka999
Copy link

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

@JakeHadley
Copy link

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

@nihp
Copy link

nihp commented Jan 6, 2020 via email

@luatnd
Copy link

luatnd commented Jan 6, 2020

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:
    'React/RCTDefines.h' file not found joltup/rn-fetch-blob#461 (comment)

    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

@qi0727
Copy link

qi0727 commented Jan 8, 2020

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

@nihp
Copy link

nihp commented Jun 8, 2020

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

@ce7elem
Copy link

ce7elem commented Jun 23, 2020

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

@nihp
Copy link

nihp commented Jun 25, 2020

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

@TylerEikenberg
Copy link

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

Thank you for this comment, this helped me solve an error I've been having.

@aqibnaveed
Copy link

aqibnaveed commented Jul 5, 2021

Using solution at no. 8 here -> #26665 (comment)

I have encountered the following error.

73 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

@facebook facebook locked as resolved and limited conversation to collaborators Oct 3, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests