在用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

当前回答

我在配置错误的xcconfig文件时遇到了这个问题。

pods生成的xcconfig没有正确地包含在我正在使用的定制xcconfig中。这导致$PODS_ROOT未被设置,导致diff“/../Podfile”失败。锁”“/清单。出于显而易见的原因,Pods将其误解为同步问题。

其他回答

对我来说,问题是我通过复制一个现有的目标在我的应用程序中创建了一个新目标,但忘记将目标添加到Podfile中。由于某种原因,克隆的目标工作了几天没有问题,但过了一段时间后,它无法通过这个错误构建。我必须在Podfile中为我克隆的项目目标创建一个新的目标条目,然后运行pod install。

在我的情况下,这个问题是由于腐败*。xcworkspace文件。它在左边的project Navigator菜单中显示了我项目的两个不同版本。

为了验证,我从Build Phases > Check Pods Manifest中的bash脚本中删除了输出重定向(> /dev/null)。lock,这样它就会把diff输出到STDOUT。果然,在阅读构建日志时,我得到了完全不同的Podfile。锁定和清单。锁输出。

为了解决这个问题,我删除了*。Xcworkspace,然后运行pod install再次从我的ios文件夹。自动重新生成工作区文件。在XCode中打开这个新文件,瞧,再也没有构建错误了。

对于在flutter中工作的我来说,由于现有的配置,配置没有自动添加。

添加“Pods/Target Support Files/Pods- runner /Pods- runner .profile”。xcconfig"到颤振/释放。Flutter/Debug.xcconfig和Flutter/Debug.xcconfig

解决了这个问题。

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功能也很管用。

删除pod .framework:

文件夹名为Pods 链接框架和库 并删除所有新的输入行从@主文件应用程序的ios