6

Note: Please make sure to comment as to what I should mention to improve this question instead of thumbing down, I was able to successfully set up React Navigation with expo for another project, and would love to get RNN up and running in this project.


I'm working on setting up React Native Navigation for my React Native app, specifically iOS using Xcode.

I've changed the AppDelegate.m file as instructed:

#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  [ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];

  return YES;
}

@end

Upon making my changes, I am receiving two Xcode errors:

'ReactNativeNavigation/ReactNativeNavigation.h' file not found
Use of undeclared identifier 'ReactNativeNavigation'

I have made sure to follow all the steps, the error is happening in the step 3 of the React Native Navigation iOS documentation

Joseph K.
  • 1,055
  • 3
  • 23
  • 46

3 Answers3

1

Try removing node_modules folder, then doing a fresh npm install or yarn install in your project directory. Following that run react-native link.

mediaguru
  • 1,807
  • 18
  • 24
  • 1
    No. I'm saying just delete your node_modules folder. Then in your project directory run: yarn install or npm install. This will reinstall all of your dependencies. Then run: react-native link to link them to your ios project: https://facebook.github.io/react-native/docs/linking-libraries-ios.html – mediaguru Jan 06 '19 at 03:50
  • Ok thank you. It took me a bit to realize what you said. I did as you mentioned and now the error message is gone. – Joseph K. Jan 06 '19 at 03:59
  • Excellent! Glad to help. – mediaguru Jan 06 '19 at 04:00
0

it mentioned here https://wix.github.io/react-native-navigation/docs/installing/ you might face this problem .

you have to add react native navigation pod file manual pod 'ReactNativeNavigation', :path => '../node_modules/react-native-navigation' to your Podfile and run cd ios && pod install

HeshamSalama
  • 148
  • 4
0

You may have forgotten to update the pods after installing the package. Run cd ios && pod install.

Ivan
  • 91
  • 7