菜鸟教程小白 发表于 2022-12-11 21:36:48

ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件


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

<hr/>

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

<p>我已按照说明更改了 <code>AppDelegate.m</code> 文件:</p>

<pre><code>#import &#34;AppDelegate.h&#34;

#import &lt;React/RCTBundleURLProvider.h&gt;
#import &lt;React/RCTRootView.h&gt;
#import &lt;ReactNativeNavigation/ReactNativeNavigation.h&gt;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation = [ jsBundleURLForBundleRoot:@&#34;index&#34; fallbackResource:nil];
;

return YES;
}

@end
</code></pre>

<p>进行更改后,我收到两个 Xcode 错误:</p>

<pre><code>&#39;ReactNativeNavigation/ReactNativeNavigation.h&#39; file not found
Use of undeclared identifier &#39;ReactNativeNavigation&#39;
</code></pre>

<p>我已确保遵循所有步骤,错误发生在 <a href="https://wix.github.io/react-native-navigation/#/docs/Installing?id=ios" rel="noreferrer noopener nofollow">React Native Navigation iOS documentation</a> 的步骤 3 中</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>尝试删除 node_modules 文件夹,然后在您的项目目录中执行全新的 npm install 或 yarn install。在运行 react-native 链接之后。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/54058375/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/54058375/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 找不到“ReactNativeNavigation/ReactNativeNavigation.h”文件