CocoaPods无法找到与"Flipper-Folly"兼容的版本。

26

我一直试图运行新的iOS系统,但是一直出现这个错误。

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/struggle/Library/Developer/Xcode/DerivedData/client-grabnjjdhfcfyugfdqcwdvbebnva/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users/struggle/Desktop/Tax/client/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

我看到一个解决方案,建议在我的podfile中添加use_flipper!({ 'Flipper-Folly' => '2.3.0' }),但现在当我运行pod install时,会出现以下错误:

`[!] CocoaPods could not find compatible versions for pod "Flipper-Folly":

In Podfile:
Flipper-Folly (= 2.3.0)

FlipperKit (~> 0.54.0) was resolved to 0.54.0, which depends on
  FlipperKit/Core (= 0.54.0) was resolved to 0.54.0, which depends on
    Flipper (~> 0.54.0) was resolved to 0.54.0, which depends on
      Flipper-Folly (~> 2.2)

FlipperKit (~> 0.54.0) was resolved to 0.54.0, which depends on
  FlipperKit/Core (= 0.54.0) was resolved to 0.54.0, which depends on
    Flipper (~> 0.54.0) was resolved to 0.54.0, which depends on
      Flipper-RSocket (~> 1.1) was resolved to 1.3.0, which depends on
        Flipper-Folly (~> 2.5)`

使用 ({'Flipper-Folly' => '2.3.0'}) 后,我又遇到了最初的错误。请帮忙解决这个问题。谢谢。

13个回答

47

在我的情况下,我只需要更新库。

pod install --repo-update

对我来说,上述命令起作用了。


2
从命令输出中:过时的源代码库,您可以使用 pod repo updatepod install --repo-update 进行更新。 - nandan

22

删除 Podfile.lock 并运行 pod install。它会开始工作。另外通过运行 sudo gem install cocoapods 更新你的 CocoaPods。


永远不要这样做!锁定文件需要指定您的软件包版本。 - Vasyl Nahuliak
你可以放心操作。因为在执行pod install命令后,会生成一个新的、更新后的Podfile.lock文件,类似于iOS版本的rm -rf node_modules && npm install命令。 - Surbhit Rao

15

截至2021年4月11日,use_flipper!({ 'Flipper-Folly' => '2.3.0' })已不再可用。现在你需要使用use_flipper!({ 'Flipper-Folly' => '2.5' })。如果将来这也无法使用,请查看错误提示,它会告诉你应该使用哪个版本。


5

针对Mac M1用户。

我刚刚更新了代码库。

arch -x86_64 pod install --repo-update

它可以正常工作。


4

移除使用Flipper的版本,这样在运行pod install时会安装最新可用版本。

因此,在Podfile中:

更改为:

use_flipper!({ 'Flipper-Folly' => '2.3.0' })

至:

use_flipper!

3
  1. 删除 Podfile.lock 文件。

  2. 在您的 Podfile 中添加以下内容:

    use_flipper!({ 'Flipper-Folly' => '2.3.0' }) #请更新这部分 post_install do |installer| flipper_post_install(installer) end

  3. 运行 pod install 命令。

如果您的 Podfile 包含以下代码或类似代码,并且其中一个项目可以成功运行,但其他项目无法正常工作,则表示

您的 Podfile.lock 中可能包含上述定义或 folly 的工作版本。

  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.build_configurations.each do |config|
      config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
      config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
  end

3
我通过运行以下命令解决了这个问题!

pod update RCT-Folly --no-repo-update


2
arch -x86_64 pod install --repo-update

在 M1 芯片的 Mac 上运行以上命令后,你会看到如下图所示的结果:

CocoaPods 找不到与 FlipperKit (0.125.0) 相容的版本:

在 Podfile 中:FlipperKit (= 0.125.0)

请看下面的图片展示:

enter image description here

0

对于 Xcode 13 和 React Native 0.66(因为问题标记了 React Native),我找到的唯一解决方案是:

 react-native start --reset-cache
 rm -rf node_modules/
 rm -rf package-lock.json 
 cd ios && pod deintegrate
 cd .. && rm -rf ios/Podfile.lock 
 npm install
 npm audit fix
 react-native link
 cd ios && pod install
 cd .. && react-native run-ios

来源:https://github.com/facebook/react-native/issues/28408


0

2022年5月27日更新:

npx pod-install --repo-update

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接