Reputation: 2071
I have integrated React Native Navigation package for my React Native application.I need to update my old React Native Navigation version to latest version. I am following it's official docs for setup:: check this link https://wix.github.io/react-native-navigation/#/docs/Installing?id=ios
I am facing an issue in iOS linking.
Error:: 'ReactNativeNavigation/ReactNativeNavigation.h' file not found
Error:: Semantic issue: Use of undeclared identifier ReactNativeNavigation
I have also followed this previous post but it's not works for me link I'm setting up React Native Navigation for my application, for iOS using Xcode.
I've made modifications in the AppDelegate.m file as followed by it's official link:
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@implementation AppDelegate
- (BOOL)application:(UIΩApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
[ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
return YES;
}
@end
Please suggest how to resolve this issue for iOS platform.
Upvotes: 3
Views: 3859
Reputation: 11
Add this line to your podfile
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
And then import the file with:
#import <React/RCTLinkingManager.h>
Upvotes: 1
Reputation: 501
I'm still having other build issues but adding the line
pod 'ReactNativeNavigation', :podspec => '../node_modules/react-native-navigation/ReactNativeNavigation.podspec'
to the Podfile in my ios directory resolved the XCode error for me. Once this line is added you have to run
pod install
from within the ios directory
The react-native-navigation documentation says that new versions of react-native will use pods. You can this see it under the Installation with CocoaPods section
https://wix.github.io/react-native-navigation/#/docs/Installing
Upvotes: 2