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 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.
file not found #import React/RCTBundleURLProvider.h
Do the following:
XCode Product ⇒ Scheme ⇒ Manage Schemes ⇒ Click '+'
At the Target Dropdown choose "React" and after saving this, scroll down and check the shared checkbox
format error when adding to AppDelegate.m
Definition of method should not be included in @interface ... end, Only properties and methods are declared in @interface ... end
You are trying to write the definition of method in,
@interface
...
@end
Instead add the method in
@implementation
...
@end
So after adding your code, it should look like below,
@implementation
/* for rn code push */
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [CodePush bundleURL];
#endif
}
@end
React/RCTBundleURLProvider.h' file not found using custom xcode build configuration
I had a similar problem and after trying many alternatives I found the problem was with custom Build Configuration in Xcode (in my case were Alpha and Beta). When you compile, apparently Xcode try to use your Target Build Config on Frameworks too, and this causes the error.
Solution One (Manual)
Do it manually as beretis answern, but it is hard to mantain, because whenever you add a new Framework/Library you have to set the Build Configs in it or new errors will appear.
Solution Two (Automated)
Use react-native-schemes-manager (https://www.npmjs.com/package/react-native-schemes-manager).
This package synchronize your custom Build Configurations in all your Frameworks.
yarn add --dev react-native-schemes-manager
or
npm install --save-dev react-native-schemes-manager
In your package.json add the postinstall command, so every time you install new package/framework it will sync you Build Configurations.
"scripts": {
"postinstall": "react-native-schemes-manager all"
},
Still in package.json, add a new key with config.
...
"xcodeSchemes": {
"Debug": ["Alpha"],
"Release": ["Beta"]
},
...
In the example above all Frameworks will have 4 Build configurations:
Debug, Release , Alpha (copied from Debug), Beta (copied from Release).
after that, just run:
npm run postinstall
Hope it helps!
Related Topics
Firebase Database Transaction When App Is in Background iOS
iOS Rich Notification Didreceivenotificationrequest Is Not Fired
How to Pretty Print Swift Dictionaries to the Console
Get Input Value from Textfield in iOS Alert in Swift
Apply Gradient Color to Arc Created with Uibezierpath
Any Way to Print in Color with Nslog
Xcode 7 Uitests with Localized Ui
Conflicting Return Type in Implementation of 'Supportedinterfaceorientations': - Warning
Detect If a Point Is Inside a Mkpolygon Overlay
Safeareainsets in Uiview Is 0 on an iPhone X
How to Make a Call Which Begin with * in Iphone
Gmsgeocoder Reversegeocodecoordinate: Completionhandler: on Background Thread
Copy Text to Clipboard with iOS
iOS App, Programmatically Get Build Version
Uiscrollview in Storyboard Not Working with iOS 8 Size Classes and Autolayout
Popping and Pushing View Controllers in Same Action
Xcode Won't Let to Build for Device After Denying Codesign to Access Keychain
Bsxpcmessage Received Error for Message: Connection Interrupted