3
votes

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.

2
make sure that libReactNativeNavigation.a is included in the main projects Link Binary With Libraries section.Akhilrajtr
Yes, I have drag and drop it from ReactNativeNavigation.xcodeproj -> Poducts -> libReactNativeNavigation.a to Link Binary With Libraries on the right pane section. Now it's marked as requiredArchana Sharma
any luck with this @ArchanaSharmauser2763557
I have cleaned my project, and then removed all reference of react native navigation library and re added library again, it resolves problem for me.Archana Sharma
You should do step 3.a on the docs.Hiếu Trần

2 Answers

2
votes

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

1
votes

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>