【问题标题】:After run pod install react get removed while upgrading react-native version运行 pod install react 在升级 react-native 版本时被删除
【发布时间】:2020-03-24 01:31:28
【问题描述】:

谁能解释为什么 pod install 会删除 React。它还显示了产品中缺少的 React-->编辑方案。

我需要任何好的解决方案

RCTBrigeModule.h 文件未找到错误?

我不知道如何解决这个问题。

在取消链接包并且不运行 pod install 之前

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
pod 'Fabric'
pod 'Crashlytics'

target 'App' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for App

  target 'App-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

    pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

    pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
    pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'

    pod 'react-native-camera', :path => '../node_modules/react-native-camera'

    pod 'RNImageRotate', :path => '../node_modules/react-native-image-rotate'

    pod 'RNShare', :path => '../node_modules/react-native-share'

    pod 'RNViewShot', :path => '../node_modules/react-native-view-shot'

    pod 'RNFS', :path => '../node_modules/react-native-fs'

    pod 'BugsnagReactNative', :path => '../node_modules/bugsnag-react-native'

    pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

    pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  end

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

链接后运行 pod install

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
pod 'Fabric'
pod 'Crashlytics'

target 'App' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for App

  target 'App-tvOSTests' do
    inherit! :search_paths
    # Pods for testing


  end

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

【问题讨论】:

  • 您要升级到 0.60+ 吗?
  • 是的,我正在尝试超过一周
  • 我有一个关于升级后生成的大文件的一般性问题。在 react-native 升级后,我发现了像 ios/Index/Datasource/something. 这样的大文件。这些文件有什么用。我需要提交这个还是需要搬入 .gitignore。你能解释一下为什么会生成它吗?

标签: react-native react-native-ios podfile podfile-lock


【解决方案1】:

如果您尝试升级到 v0.60+,您必须使用此工具手动执行此操作。 (https://react-native-community.github.io/upgrade-helper/)。有许多重大变化,包括 pod 支持和 androidX 支持。

将所有库更新到最新版本,在从 Xcode 升级 RN 之前删除所有手动链接的库,以避免 Xcode 崩溃。

这篇文章可能对https://reactnative.thenativebits.com/courses/upgrading-react-native/upgrade-to-react-native-0.60/有帮助

【讨论】:

  • 我收到此错误在 ../node_modules/bugsnag-react-native 中找不到 BugsnagReactNative 的 podspec
  • 你能发布你的 Podfile 吗?
  • 在我的问题中的 podfile 中更新,该问题位于取消链接包之前和不运行 pod 安装之前。此外,我添加了 use_native_modules!低于 AppTests 目标
  • 你试试这个答案吗(stackoverflow.com/questions/41663002/…)
  • @Lenoarod 这对我不起作用。您是否知道 Link Binaries Framework 的任何解决方案不显示 lib 文件夹而不是显示 Frameworks
猜你喜欢
  • 1970-01-01
  • 2022-08-04
  • 2018-12-30
  • 2021-08-25
  • 2023-02-01
  • 1970-01-01
  • 2020-05-12
  • 2020-11-06
  • 1970-01-01
相关资源
最近更新 更多