Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native 0.40.0 : RCTBundleURLProvider.h” file not found - AppDelegate.m

I am getting following error with react native version 0.40.0 version React/RCTBundleURLProvider.h' file not found.

I tried deleting node modules , installing it with npm install and clearing watchman.multiple times. But still not able to get it working.

like image 747
AK2016 Avatar asked Jan 17 '17 18:01

AK2016


2 Answers

Got it working by dropping the default target on XCode and recreating it again.

Also, make sure to check Manage Schemes > [select your main target] > Edit > Build tab.

Xcode Schemes

Check that React is in the list, and mark the scheme as Shared. Otherwise, it will be saved in your user's folder and GIT will ignore it.

Hope it helps, official docs didn't help

like image 56
brickpop Avatar answered Oct 24 '22 23:10

brickpop


As of React Native 0.40 (see release notes), native code on iOS must refer to headers out of the react namespace. Previously the following would work:

#import "RCTBundleURLProvider.h"

But now all headers have been moved:

#import <React/RCTBundleURLProvider.h>

If you are updating an existing project, you need to either

  • run react-native upgrade and merge these changes manually,
  • use the new react-native-git-upgrade tool, or
  • manually change all header imports to the new format.
like image 30
jevakallio Avatar answered Oct 24 '22 22:10

jevakallio