OGeek|极客世界-中国程序员成长平台

标题: ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 21:36
标题: ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件

注意:请务必评论我应该提到什么来改进这个问题,而不是一味地贬低,我能够成功地为另一个项目设置带有 expo 的 React Navigation,并且会喜欢在这个项目中启动并运行 RNN。


我正在为我的 React Native 应用程序设置 React Native Navigation,特别是使用 Xcode 的 iOS。

我已按照说明更改了 AppDelegate.m 文件:

#import "AppDelegate.h"

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

@implementation AppDelegate

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

  return YES;
}

@end

进行更改后,我收到两个 Xcode 错误:

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

我已确保遵循所有步骤,错误发生在 React Native Navigation iOS documentation 的步骤 3 中



Best Answer-推荐答案


尝试删除 node_modules 文件夹,然后在您的项目目录中执行全新的 npm install 或 yarn install。在运行 react-native 链接之后。

关于ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54058375/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4