【问题标题】:Pod install error after upgrading to React Native 0.63.0升级到 React Native 0.63.0 后 Pod 安装错误
【发布时间】:2020-07-16 09:16:58
【问题描述】:

我使用的是 React Native 版本 0.62.2,现在我升级到版本 0.63.0 并在运行 npx pod-install 以安装 Pod 包后出现此错误:

CocoaPods 找不到 pod “ReactCommon/callinvoker” 的兼容版本:

【问题讨论】:

    标签: javascript ios reactjs react-native react-native-ios


    【解决方案1】:

    实际上,我只是删除了Podfile.lock 并删除了整个Podfile 并从最新版本的新安装的React Native 项目中添加了新内容,这意味着它的内容应该是:

    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
    require_relative '../node_modules/react-native/scripts/react_native_pods'
    
    platform :ios, '10.0'
    
    target '[YourProjectName]' do
      config = use_native_modules!
      use_react_native!(:path => config["reactNativePath"])
    
      target '[YourProjectName]Tests' do
        inherit! :complete
        # Pods for testing
      end
    
      # Enables Flipper.
      #
      # Note that if you have use_frameworks! enabled, Flipper will not work and
      # you should disable these next few lines.
      use_flipper!
      post_install do |installer|
        flipper_post_install(installer)
      end
    end
    
    target '[YourProjectName]-tvOS' do
      # Pods for [YourProjectName]-tvOS
    
      target '[YourProjectName]-tvOSTests' do
        inherit! :search_paths
        # Pods for testing
      end
    end
    

    注意很明显你应该用[YourProjectName]替换你的项目名称。

    提示如果您使用手动链接,请取消所有链接,我在手动链接react-native-vector-icons时遇到严重问题

    之后,在项目的根目录下运行npx pod-install 命令,一切都会回到正轨。

    【讨论】:

      【解决方案2】:

      您应该删除 Podfile.lock 并在 ios 文件夹中时在终端上运行此代码

      rm -rf ./*.xcworkspace  && rm -rf ./pods && pod install
      

      【讨论】:

        猜你喜欢
        • 2020-05-12
        • 1970-01-01
        • 1970-01-01
        • 2016-03-10
        • 1970-01-01
        • 2018-09-07
        • 1970-01-01
        • 2019-03-07
        • 1970-01-01
        相关资源
        最近更新 更多