【问题标题】:CocoaPods could not find compatible versions for pod "lottie-ios"CocoaPods 找不到 pod“lottie-ios”的兼容版本
【发布时间】:2021-05-11 02:41:31
【问题描述】:

我无法为 lottie-react-native CocoaPods 安装 react-native-lottie 抛出错误兼容版本找不到 pod "lottie-ios" 的兼容版本

【问题讨论】:

    标签: node.js reactjs react-native


    【解决方案1】:

    通过卸载之前安装的 Lottie 版本解决了这个问题

    1- yarn add lottie-react-native@4.0.3
    2- yarn add lottie-ios@3.2.3
    

    【讨论】:

      【解决方案2】:

      您需要在您的 PODFILE 中升级您的 platform :ios 版本

      就我而言,我将 platform :ios 从 10 更改为 11,一切正常

      【讨论】:

      • 该行应该类似于platform :ios, '12.1'
      【解决方案3】:

      如果你得到这样的东西,

      [!] CocoaPods could not find compatible versions for pod "lottie-ios":
        In Podfile:
          lottie-ios (from `../node_modules/lottie-ios`)
      
          lottie-react-native (from `../node_modules/lottie-react-native`) was resolved to 3.5.0, which depends on
            lottie-ios (~> 3.1.8)
      

      那么我们可以通过以下步骤解决,

      • 在您的 react native 项目的根文件夹中打开终端。

      • 执行以下命令安装lottie-ioslottie-react-native包指定版本的cocoa pod报错。

        npm install lottie-ios@3.1.8 
        npm install lottie-react-native@3.5.0
        
      • 这些包添加后移动到 ios 文件夹并运行 pod install。

        cd ios
        pod install
        

      【讨论】:

        【解决方案4】:

        根据错误说我们需要去

        npm i lottie-ios@3.1.8 lottie-react-native@3.5.0 光盘 Pod 安装

        问题已解决

        【讨论】:

        • 使用这些特定版本也为我解决了这个问题。我想使用最新版本是问题
        • 以上答案工作正常。只需确保在重新安装依赖项之前删除 node_modules、podfile.lock 和 pods 文件夹即可。这确保了它的工作原理。
        • 从 Lottie 的官方文档中,他们已将版本更新为 lottie-ios@3.2.3 github.com/lottie-react-native/…
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-07-29
        • 2021-07-21
        • 2019-05-07
        • 2021-09-04
        • 2021-09-23
        • 2021-07-12
        • 1970-01-01
        相关资源
        最近更新 更多