问题描述
当我尝试在Xcode(6.4)上构建时出现此错误。我有两个目标,但现在我只希望其中至少有一个能工作。
I’m getting this error when I try and build on Xcode (6.4). I have two targets, but for now I just want at least one of them to work.
ld:-lPods-ObjectiveSugar找不到库
这是我的Podfile(它是为两个目标设置的,但之前只有一个,但有相同的错误):
Here’s my podfile (it is set up for two targets, but I had only one before with same error):
target ‘AppName_iOS' do
pod 'ObjectiveSugar', '~> 1.1'
pod 'SWRevealViewController', '~> 2.3'
pod 'Masonry', '~> 0.6'
pod 'AUISelectiveBordersView', '~> 0.0'
pod 'AFNetworking', '~> 2.6'
#pod 'DSNestedAccordion', '~> 0.1'
pod 'SparkInspector'
pod 'CocoaLumberjack', '~> 2.0'
end
target 'AppName_iOS_CI' do
pod 'ObjectiveSugar', '~> 1.1'
pod 'SWRevealViewController', '~> 2.3'
pod 'Masonry', '~> 0.6'
pod 'AUISelectiveBordersView', '~> 0.0'
pod 'AFNetworking', '~> 2.6'
#pod 'DSNestedAccordion', '~> 0.1'
pod 'CocoaLumberjack', '~> 2.0'
end
我将ObjectiveSugar移到列表的下方,但仍然遇到问题有了它,我就去了图书馆,并在可可豆荚外面自己链接了它。问题仍然存在。
I moved ObjectiveSugar down the list and still got issues with it, so I went ahead and removed the library and linked it myself, outside of cocoa pods. The issue still remains.
尝试了此帖子中的所有内容:
Tried everything on this post:Cocoapods ld: library not found for -lPods-Projectname
-
再次删除并添加库(pod安装),删除Link Binary中的
-lPods-Projectname.a(从具有应用程序目标的库的链接二进制文件中删除二进制文件,构建阶段。)
Removing and adding the library again (pod install) Deleting the-lPods-Projectname.a in Link Binary ( deleting binary from link binary with libraries on App target, build phases.)
尝试构建主动式体系结构,是和否。
Tried Build Active Architectures YES and NO.
尝试拆装pod,然后安装pod。
Tried pod deintegrate and then pod install.
我还没有卸载Xcode,也没有重新安装可可豆荚,等等……这似乎有些过分。
I haven’t uninstalled Xcode, and reinstalled cocoa pods, etc… That seems overkill.
还尝试了本疑难解答指南(4.如果Xcode在链接时抱怨)
Also tried everything in this troubleshooting guide http://guides.cocoapods.org/using/troubleshooting.html (4. If Xcode complains when linking)
让我知道我如果您需要更多信息。任何帮助,将不胜感激。谢谢。
Let me know if you need more info. Any help would be appreciated. Thanks.
推荐答案
最终找到了问题。
在Xcode上,构建目标的设置,我搜索了其他链接器标志。我在那里:
On Xcode, build settings for the target, I searched for "Other Linker Flags". There I had this:
-l Pods-ObjectiveSugar
这是我几个月前做的一些解决方法,无法解决此问题。目前不记得要怎么解决。删除它可以解决问题。
This was some kind of workaround I did several months back to fix some issue. Can't remember what, at this point. Removing it solved the issue.
为了安全起见,我所做的是:
What I did, just to be safe, was:
- 我使用
pod解粉对可可豆荚进行了粉碎
。选中此链接 https://github.com/kylef/cocoapods-deintegrate。 - 我在目标设置和项目文件中搜索了
pod
。任何看起来像属于可可豆的东西,我都删除了。 - 然后我再次运行
pod安装
。
- I deintegrated cocoa pods, using
pod deintegrate
. Check this link https://github.com/kylef/cocoapods-deintegrate. - I searched on the target settings and project file for
pod
. Anything that looked like it belonged to cocoa pods, I removed. - Then I ran
pod install
once again.
希望这可以帮助其他迷路的人。
Hope this helps other lost souls.
这篇关于Cocoapods ld:-lPods-ObjectiveSugar找不到库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!