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)
React Native version: 0.61.1
Steps To Reproduce
- 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)
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:
Check if XCode > Product > Schema > Edit Schema > Build has React(missing) or not
pod 'React', :path => '../node_modules/react-native/'
from Pod, or they usetarget.remove_from_project
to remove it onpost_install
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):
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 fileIf 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 moreIf 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
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
If the issue still exists, it’s might be the library *.podspec or sth else, you need to investigate further.
If you write own your library, use
__has_include
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… 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…
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
. underprivacy
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.
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)
It worked for me in the latest RN version.
Here is what worked for me:
I’m also having this issue. Any update?