RNN Pod 尚未添加到 Podfile

RNN Pod has not been added to Podfile

我正在尝试将 React 本机导航添加到开箱即用的 Hello world React 本机应用程序。我正在按照此文档中的步骤进行操作。

https://wix.github.io/react-native-navigation/docs/installing

在 运行 脚本之后,我 运行 进入这个输出。

Running Android postlink script.

Linking MainApplication...
   Extending NavigationApplication
   Changing host implementation to NavigationReactNativeHost
   Removing call to SOLoader.init()
MainApplication.java linked successfully!

Linking MainActivity...
   Extending NavigationActivity
   Removing getMainComponentName function
MainActivity linked successfully!

Linking root build.gradle...
   Adding RNNKotlinVersion to extension block
   Adding Kotlin plugin
   Updating minSdkVersion to 19
Root build.gradle linked successfully!

Running iOS postlink script.

Linking AppDelegate...
   Removing Unneeded imports
   All imports have been removed
   Importing ReactNativeNavigation.h
   Bootstrapping Navigation
   Removing Application launch content
   Application Launch content has been removed
AppDelegate linked successfully!

Updating Podfile...
   RNN Pod has not been added to Podfile

React Native Navigation link is completed. Check the logs above for more information.

   If any of the steps failed, check the installation docs and go through the necessary steps manually:
   https://wix.github.io/react-native-navigation/docs/installing#manual-installation

When you're done, don't forget to update the index.js file as mentioned in docs!

Thank you for using React Native Navigation!

我尝试手动添加 pod,我明白了。

[!] There are multiple dependencies with different sources for `ReactNativeNavigation` in `Podfile`:

- ReactNativeNavigation (from `../node_modules/react-native-navigation`)
- ReactNativeNavigation (from `../node_modules/react-native-navigation/ReactNativeNavigation.podspec`)

我只是想添加反应导航来反应本机应用程序。这就对了。我该如何解决这个问题?

我已经在这里提出了这个问题 https://github.com/wix/react-native-navigation/issues/6470 但如果有人可以提供帮助,我也会在这里发布这个问题。

在上面链接的 GitHub 问题上有一个小的讨论,解决方案已解决。

为了其他人的利益,在此发布一个简短的解决方案。

第 1 步 - 将以下内容添加到您的 pod 文件中。

target 'baribasicreact' do
  pod 'ReactNativeNavigation' , :podspec => '../node_modules/react-native-navigation' 

第 2 步 - 安装 pods。

cd iOS & pod install

问题中链接的 GitHub 问题中有更多详细信息。