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

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库到Xcode构建方案来修复它,在我能够运行它之后,试图从构建方案中删除这个,但它仍然为我工作良好。我想不出确切的原因。

其他回答

在所有pod中只使用_active_arch =NO解决了我的问题。为了让它持久,我在Podfile中添加了一个post_install钩子:

post_install do |installer_representation|
  installer_representation.project.targets.each do |target|
      target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
      end
  end
end

Pod安装完成。

我在存档提交时也遇到了同样的问题。 关于这个问题的讨论可以在这里找到:https://github.com/CocoaPods/CocoaPods/issues/155

总之,有两种方法适合我:

将“首选项->位置->高级”设置为“自定义(相对于工作空间)”或 设置Podfile为- platform:ios,:deployment_target => "5.0"

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

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

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

我使用旧的cocoapod版本后更新了cocoapods,它建议我更新我安装的pod,因为我更新了很长一段时间。我更新了它,新版本pod更新得很好。但在那之后,我得到了像库没有找到-lPods-xxxprojectName-xxxxxpodName这样的错误

在尝试了这么多的解决方案后,给出的答案在这个thrred,这不是为我工作。然后我去我的项目设置,发现豆荚路径是改变,这是在其他链接标志

检查你的管理方案,以获得正确的pod名称,并在其他链接标志中进行比较,如果不相似,请更改它

旧吊舱路径是l -“lpods - xxxprojectnaxxxxpodname”

但是新的pods只有xxxxxpodName,所以我用新的替换了其他链接标志,如下所示

改为pod路径-l"xxxxxpodName",它是有效的。

我不知道这背后的完美原因,但这可能会帮助一些人。