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

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'

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


当前回答

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".

其他回答

如果你使用的是iOS7和Xcode 5,请:

选择你的Pods项目。 转到目标Pods,在构建设置中,选择架构->标准架构(armv7, armv7s)。 对Pods项目的每个Target执行同样的操作。

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

pod update

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

如果你正在为iOS7和Xcode5存档,并得到这些错误,请参考这个链接。苹果似乎放弃了可可豆荚所需要的架构 https://github.com/CocoaPods/CocoaPods/pull/1352

我有同样的问题,当我编辑Podfile添加目标,我是使用没有目标之前。

子文件

target 'xxxx' do

pod 'xyz'
pod 'abc'    

end

在四处闲逛后,我发现在目标属性>>常规选项卡>>链接框架和库部分,有新的libPods-xxxx。a和旧的libPods.a

我只是删除了libPods。A,一切都很好。

我把这里的每个答案都看了一遍,但对我来说太简单了……转到Target -> Build Phases,然后删除libPods-YourProject。A,然后用“+”再加一次。别担心图书馆是红色的,没事的。