在用cocoapods安装RestKit之后,我遇到了一个奇怪的问题。 在用cocoapods解决我的项目的RestKit依赖关系并试图构建它之后,我面临这个错误:

沙箱与Podfile.lock不同步。运行“pod install”或更新CocoaPods安装。

我试着运行pod安装,但没有变化。

以下是一些照片:

  PODS:
  - AFNetworking (1.3.3)
  - RestKit (0.20.3):
    - RestKit/Core
  - RestKit/Core (0.20.3):
    - RestKit/CoreData
    - RestKit/Network
    - RestKit/ObjectMapping
  - RestKit/CoreData (0.20.3)
  - RestKit/Network (0.20.3):
    - AFNetworking (~> 1.3.0)
    - RestKit/ObjectMapping
    - RestKit/Support
    - SOCKit
  - RestKit/ObjectMapping (0.20.3)
  - RestKit/Search (0.20.3):
    - RestKit/CoreData
  - RestKit/Support (0.20.3):
    - TransitionKit (= 1.1.1)
  - RestKit/Testing (0.20.3)
  - SOCKit (1.1)
  - TransitionKit (1.1.1)

DEPENDENCIES:
  - RestKit (~> 0.20.0)
  - RestKit/Search (~> 0.20.0)
  - RestKit/Testing (~> 0.20.0)

SPEC CHECKSUMS:
  AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66
  RestKit: 1f181c180105a92f11ec4f6cd7de37625e516d83
  SOCKit: 2f3bc4d07910de12dcc202815e07db68a3802581
  TransitionKit: d0e3344aac92991395d4c2e72d9c5a8ceeb12910

COCOAPODS: 0.29.0

当前回答

我找了几个小时,找到了如下的解决方案:

在我的例子中,方法1是有效的。

方法1:

选择目标>,进入Build Phases >,单击Link Binary With Libraries >,删除所有libPods。一个文件 打开终端>直接到你的项目>运行: 圆荚体安装 清洁和建造项目

ref . 1

方法2:

打开终端>直接到你的项目>运行: Pod分解——冗长 Pod安装—详细

ref . 2

方法3:

选择目标>进入构建设置>点击“+”符号 add 2用户自定义设置:[to the left = to right] PODS_ROOT = ${SRCROOT}/Pods

and

    PODS_PODFILE_DIR_PATH = ${SRCROOT}/

ref.3

其他回答

Completely nothing worked out for me from these answers. Had to create the project again by running cordova platform add ios. What I've noticed, even freshly generated project with (in my case) Firebase pods caused the error message over and over again. In my opinion looks like a bug for some (Firebase, RestKit) pods in Xcode or CocoaPods. To have the pods included I could simply edit my config.xml and run cordova platform add iOS, which did everything for me automatically. Not sure if it will work in all scenarios though.

编辑:我有一个Podfile从以前的iOS/Xcode,但最新的今天有# DO NOT MODIFY -自动生成的Apache Cordova在Podfile。这让我的脑海中亮起了一盏灯,开始尝试这种方法。看起来有点琐碎,但很管用,我的Firebase功能也很管用。

我有这个问题时,我试图删除以前安装的库

@Michal的回答帮助了我

删除或卸载之前添加的库:cocoapods

以下华氏先生的回答帮助我解决了mac m1上的问题,而不是pod安装是运行:

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

而不是吊舱安装

我尝试了各种pod安装组合,删除node_modules并重新安装,清理和重建xcode项目,甚至重新启动我的计算机。这些对我都没用……

我的解决方案是在项目的根目录下运行pod—version。我不知道如何或为什么,但这成功地安装了一个缺失的依赖,所以我想我在这里分享它,以防它帮助其他人:)

如果你在Podfile中删除目标的所有pod,例如:

target 'myTarget' do
pod 'great-stuff', '~> 4.0'  // you deleted this last pod
end

你需要从你的Xcode目标构建阶段手动删除这些构建步骤:

检查pod Manifest.lock 复制Pod资源

Cocoapods(当前稳定版本0.37.2)在运行pod install时不执行此清理。