React Native 0.40.0 : RCTBundleURLProvider.h” file not found - AppDelegate.m
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.
RCTBundleURLProvider.h file not found - AppDelegate.m
Delete node modules, then run npm install
(or better yet yarn) and after everything has finished downloading, run react-native upgrade
which should give you the option to replace old files with the template ones, by doing so you re-link your native dependencies in react-native which should fix your problem. Of course don't forget to clean your project in Xcode.
`React/RCTBridgeModule.h` file not found
In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here: Reliable build on ^0.39.2
fails when upgrading to ^0.40.0
).
What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before actually building the react library.
The solution in my case was to:
Disable the parallel builds:
- Xcode menu -> Product -> Scheme -> Manage Shemes...
- Double click on your application
- Build tab -> uncheck Parallelize Build
Add react as a project dependecy
- Xcode Project Navigator -> drag React.xcodeproj from Libraries to root tree
- Build Phases Tab -> Target Dependencies -> + -> add React
Using package-lock.json with version control
- When you install the dependencies of libraries, you need to lock down the version of them. So You should get used to the package manager like npm, yarn, ...
- I recommend use
Yarn
This is the document for how to using it. https://yarnpkg.com/en/docs - ie: install lib react-native-button. you just need run command
yarn add react-native-button
and commit the yarn.lock with package.json files. Then the guys in your team can pull these changes and run 'yarn install' to keep the synchronize for you projects. - Check it out and try. it is simple!
Related Topics
Sprite Kit Collision Detection
Restkit 0.20 JSON Mapping Along with Additional Offline Data
Converting String to Nsdate Giving Wrong Date
How to "Rerequest" Email Permission Using Facebook iOS Sdk 4.X
How to Print Out(Nslog) The Properties of a Custom Object Added to a Nsmutablearray
Start Position of Table View Is Wrong in Simulator, and Is Not The Same in Storyboard
How to Programmatically Wrap Png Texture Around Cube in Scenekit
Error When Instantiating a UIfont in an Text Attributes Dictionary
Add a UIbutton as a Subview to a UItabbar
Detect Array with Issue (Debug Mode)
Multiple Async Requests at Once in Objective C
Swift - Weekday by Current Location by Currentcalendar()
How to Get Original Nsdata of UIimage
Trim End Off of String in Swift, Getting Error at Runtime
Contentview with UItableview Not Scrolling Within UIscrollview