File "RCTBundleURLProvider.h" not found - AppDelegate.m

I am trying to run a React Native application in Xcode and I keep getting this error. I can’t figure out how to solve the problem. Any suggestions?

Xcode error screenshot:

screenshot

+118
ios xcode react-native
Nov 01 '16 at 20:35
source share
23 answers

Remove the node modules, then run npm install (or, even better, yarn), and after everything finishes loading, run react-native upgrade , which should provide you with the opportunity to replace the old files with the template ones, thereby re-linking your own dependencies in reaction-native that should fix your problem. Of course, don't forget to clean your project in Xcode.

+61
Nov 01 '16 at 21:26
source share

xcode Product-> Scheme-> Manage Schemes press "+" in Target to select "React" and set that React is shared.

+246
May 18 '17 at 6:13
source share

For all those using React Native 0.40.0 or higher, the import header has a significant change from RN 0.40.0 and results in a large number of .h files being detected. react-native-git-upgrade fixed the problem for me during debugging, but the assembly failed in the release / archive.

I am using RN 0.42.3 with cocoapods and Xcode 8.2.1

To completely fix this, go to Xcode> Product> Scheme> Edit Scheme>

  • Untick Parallelize Build enter image description here
  • Click the "+" button in "Goals" and add Responsive enter image description here
  • Drag the added Responses to the top of the list in Goals. enter image description here

Now clean the project and build

+19
Mar 24 '17 at 18:48
source share

None of the other suggestions corrected my mistake, but this one did.

1 - Create subfile

Create a file called ios/Podfile inside your ios/Podfile application with the following contents:

 # You Podfile should look similar to this file. React Native currently does not support use_frameworks! source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' target '<YOUR_APP_NAME>' do # Fixes required for pod specs to work with rn 0.42 react_native_path = "../node_modules/react-native" pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga" pod "React", :path => react_native_path, :subspecs => [ 'Core', 'RCTActionSheet', 'RCTAnimation', 'RCTGeolocation', 'RCTImage', 'RCTLinkingIOS', 'RCTNetwork', 'RCTSettings', 'RCTText', 'RCTVibration', 'RCTWebSocket' ] pod 'GoogleMaps' # <~~ remove this line if you do not want to support GoogleMaps on iOS # when not using frameworks we can do this instead of including the source files in our project (1/4): # pod 'react-native-maps', path: '../../' # pod 'react-native-google-maps', path: '../../' # <~~ if you need GoogleMaps support on iOS end 

2 - Set subfile

Run the pod install command from the ios folder.

3 - Reset Xcode

Restart Xcode and the error should go away.

+17
Mar 13 '17 at 21:04
source share

I ran into this problem after the first attempt to run React build in Xcode, and all I had to do was actually build and run so that the error disappears (after choosing the command and preparing it correctly). Sometimes Xcode shows errors that are not really errors until they compile and bind things together for the first time.

+9
Jun 14 '17 at 23:36 on
source share

I solved this problem by following these steps:

  1. In xcode, select the project root.
  2. Drag React.xcodeproj from Libraries to the root of the project.
  3. Click on the name of the project (in my case it’s the name SaleKit ) in TARGETS
  4. Choose Build Phases
  5. In the Target Dependencies drop-down list, add React
  6. Restore or restart

enter image description here

+7
Jun 07 '17 at 23:42 on
source share

For my case in ReactNative "0.54.2" I solved this with the following solution

In Product->Scheme->Manage Schemes select Product->Scheme->Manage Schemes , uncheck "YourProject" -tvOS to set it as not Shared

+6
Mar 13 '18 at 8:36
source share

The solution that works for me is to share the React schema.

If you don’t have a React scheme, create a new one using the Selecting scheme menu -> Manage Scheme -> + -> choose React , then mark the React scheme as Shared

enter image description here

enter image description here enter image description here

Alternatively, if you are using Xcode 10, go to File -> Project Settings and select Legacy build system

enter image description here

+6
Sep 04 '18 at 8:50
source share

Run npm install in the project directory to install react-native resolution for this error.

+3
Oct 18 '17 at 10:56 on
source share

You may have a .xcodeproj file after installing the pod module.

Close it and open the .xcworkspace file. It worked for me.

+3
Aug 13 '18 at 7:30
source share

Try the following:

  • Clear ( cmd + shift + K ).
  • Build core React - select React as a scheme in Xcode and build it ( cmd + B ).
  • Build a library that does not work (for example, RCTText).
  • Build your application.
+2
Apr 29 '17 at 14:55
source share

I had the same problem and fixed it by placing RNFIRMessaging.h over React / RCTBundleURLProvider.h

So, I look like this:

 #import "AppDelegate.h" #import "RNFIRMessaging.h" #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> 
+2
Apr 29 '17 at 21:27
source share

The best decision:

Open β€œBuild Settings” for your project in Xcode, find β€œHeader Search Path”.

Double-click next to β€œTitle Search Path,” where other properties have a yes or no.

Now add the following to the "Header Search Path" (in the build settings):

$ (SRCROOT) /../ node_modules / react-native / React $ (SRCROOT) /../ node_modules / react-native / React / Base Remember to make them both recursive.

+2
Jan 18 '19 at 19:34
source share

I ran into the same problem. Then I deleted node.try to use these steps

  • Delete node_modules folder - rm -rf node_modules && & & & npm install
  • Reset cacheager - rm -fr $ TMPDIR / response- * or node_modules / react-native / packager / packager.sh - reset -cache
  • Clear watchman watches - watchman-del-all

then build and see

+1
Nov 02 '16 at 6:56
source share

In the base directory of the project, I run:

node_modules/react-native/packager/packager.sh --reset-cache

The result is:

 Scanning 554 folders for symlinks in /Users/..../work/..../react_tutorial/AwesomeProject/node_modules (15ms) β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Running packager on port 8081. β”‚ β”‚ β”‚ β”‚ Keep this packager running while developing on any JS projects. Feel β”‚ β”‚ free to close this tab and run your own packager instance if you β”‚ β”‚ prefer. β”‚ β”‚ β”‚ β”‚ https://github.com/facebook/react-native β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ Looking for JS files in /Users/..../work/...../react_tutorial/AwesomeProject Loading dependency graph... ERROR Packager can't listen on port 8081 Most likely another process is already using this port Run the following command to find out which process: lsof -i :8081 

I found that the package manager cannot work when another package process is running.

I found that the process works with:

lsof -i :8081

Than I kill 9 ... process.

After I closed Xcode, run:

npm install

And Xcode started again, from that moment everything works as expected !!

+1
Feb 05 '17 at 8:26
source share

I found that my fix for this problem after updating React was to change the #import "RCTBundleURLProvider.h" to #import <React/RCTBundleURLProvider.h>

+1
Mar 29 '17 at 19:36
source share

click Product-> Schema-> Manage Schemes -> +. and then add react as sharing. also make sure your project name is there.

+1
Dec 21 '18 at 9:22
source share

If you did not run npm install , you are likely to run into this problem.

0
Jan 10 '17 at 7:07 on
source share

I tried all the suggestions and none of them worked in i, I deleted the repo and cloned it again, and it works for me, so my suggestion commits your changes and they clone the repo again, which worked for me.

0
Sep 01 '17 at 5:01 on
source share

I have reviewed all the answers mentioned above.

Here is the solution for me:

STEP 1:

Launch:

 npm install react-native-fcm --save 

This will create a directory in your project under node_modules> response-native-fcm

Add responsive-native-fcm to your project

STEP 2:

You need to add '$(SRCROOT)/../node_modules/react-native-fcm/ios' in the header search path in the build settings.

Add Header Search Paths

These two steps worked for me to remove the error.

You can find more detailed information at the links:

https://github.com/evollu/react-native-fcm/issues/63

https://github.com/evollu/react-native-fcm/issues/21

0
Oct 23 '17 at 12:56 on
source share

In my case, I could not remove node_modules and reinstall, and also could not do react-native-git-updgrade or react-native upgrade , because I wanted to stay on RN-0.59, because .60 causes problems for my dependencies.

In any case, my situation was that I was missing the file 'React / RCTBundleURLProvider.h'. I already had React available in my schemas. This was not in my library directory. I checked my target build settings.

Inside the target dependencies, I also had React.

I removed the β€œReact” target dependency, then added it again. cleaned the folder assembly, rebuilt the project. it worked.

0
Sep 03 '19 at 23:28
source share

you need to set native response in terminal mode

 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

then

 brew install node brew install watchman npm install -g react-native-cli 

Source:
https://facebook.imtqy.com/react-native/docs/getting-started.html

-one
Jan 17 '17 at 17:13
source share

Make sure the path to your project has no spaces. Just renaming folders and removing spaces solves the problem for me.

-2
Aug 01 '17 at 9:26
source share



All Articles