我存档一个项目时出错了。这就是我的环境。

Mac OS Lion Xcode 4.3.1 iOS SDK 5.1

项目部署目标为:

IPHONEOS_DEPLOYMENT_TARGET 3.2

错误显示:

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我猜Pods就是我用来管理XCode项目依赖的CocoaPods。 https://github.com/CocoaPods/CocoaPods

这是我的Podfile

platform :ios  
dependency 'libPusher', '1.1'

我不确定这个错误是什么意思?


当前回答

如果你仍然遇到这个问题,试试:

pod update

已经做完了,希望这能帮到你。

其他回答

CocoaPods在GitHub上的wiki在他们的常见问题解答中有正确的答案:

Go to Product > Edit Scheme Click on Build Add the Pods static library, and make sure it's at the top of the list Clean and build again If that doesn't work, verify that the source for the spec you are trying to include has been pulled from github. Do this by looking in <Project Dir>/Pods/<Name of spec you are trying to include>. If it is empty (it should not be), verify that the ~/.cocoapods/master/<spec>/<spec>.podspec has the correct github url in it. If still doesn't work, check your XCode build locations settings. Go to Preferences -> Locations -> Derived Data -> Advanced and set build location to "Relative to Workspace".

我想念libPods。目标中的A,所以要做的第一件事是将它添加到链接的框架和库中。

接下来,Product -> Build for -> Profiling(或在添加libPods之前)。A,如果你完全错过了它)

最后在构建阶段检查你的Copy Pods资源脚本(如果它和你的第二个目标相同-有时它取决于Podfile和它的目标)。然后您就可以成功构建了。

如果你仍然遇到这个问题,试试:

pod update

已经做完了,希望这能帮到你。

通过以下步骤解决这个问题:

更新cocoapods安装。$ [sudo] gem install cocoapods 重新安装项目下的依赖项。(舱安装) 清理和重建/存档。

简化一下@i4niac的回答:

另一个常见的原因是方案的构建配置不匹配。 在我们的案例中,我们的“AppName-AppStore”方案将“发布”作为存档构建配置,而不是“AppStore”。