I got an error when archiving a project. This is my environment.
- Mac OS Lion
- Xcode 4.3.1
- iOS SDK 5.1
The project deployment target is:
IPHONEOS_DEPLOYMENT_TARGET 3.2
The error shows:
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I guess Pods is CocoaPods that I used to manage XCode project dependencies. https://github.com/CocoaPods/CocoaPods
This is my Podfile
platform :ios
dependency 'libPusher', '1.1'
I am not sure what the error means?
In my case the problem was that Xcode's Derived Data location was set to the "Legacy" option. The CocoaPods target (libPods.a) was being built correctly, but Xcode was looking in the wrong place for it.
Switching it to "Unique" (the default) solved the issue. You can do this by going to Preferences > Locations and clicking the Advanced... button.
I tried EVERY answer in this thread to no avail. Finally resolved my issue by matching the "Pre-Configuration Build Products Path" in my target project with the value in the Pods project. Turns out they were building to two different output locations. None of the other suggestions in this thread were relevant for me. Would be great if XCode gave a useful error description (like WHY it can't use the lib - File Not Found, No matching architecture found, etc.).
try open xcworkspace file instead of xcodeproj file
In my case
pod install
fixed the problem, after creating distribution and release schemes.I had divided my pod listings in the
Podfile
for different targets like:And ran a
pod install
This created a new library
libPods-ABC.a
to which my binary had to link to. But the bug was that it didn't delete the previous library i.e.libPods.a
.Solution : Remove the library
libPods.a
fromBuild Phases
ofLink Binary With Libraries
.If you are still getting this issue, try:
Did the work for me, hope this helps you.