Reputation: 1403
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: library not found for -lPods-ObjectiveSugar
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
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
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.
Tried pod deintegrate and then pod install.
I haven’t uninstalled Xcode, and reinstalled cocoa pods, etc… That seems overkill.
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.
Upvotes: 1
Views: 602
Reputation: 1403
Finally found the issue.
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 deintegrate
. Check this link https://github.com/kylef/cocoapods-deintegrate.pod
. Anything that looked like it belonged to cocoa pods, I removed.pod install
once again.Hope this helps other lost souls.
Upvotes: 1