2

So I've added some Cocoapods to a project, and now when I build, I'm getting the following error:

Ld Build/Products/Debug-iphonesimulator/[AppName].app/[AppName] normal x86_64
    cd /Users/[username]/Developer/[AppName]
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk -L/Users/[username]/Developer/[AppName]/Build/Products/Debug-iphonesimulator -L/Users/[username]/Developer/[AppName] -F/Users/[username]/Developer/[AppName]/Build/Products/Debug-iphonesimulator -filelist /Users/[username]/Developer/[AppName]/Build/Intermediates/[AppName].build/Debug-iphonesimulator/[AppName].build/Objects-normal/x86_64/[AppName].LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lCMDQueryStringSerialization -lISO8601 -lReactiveCocoa -lSimpleAuth -lc++ -lpop -framework Foundation -framework UIKit -lPods-CMDQueryStringSerialization -lPods-ISO8601 -lPods-ReactiveCocoa -lPods-SimpleAuth -framework Foundation -framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.0 -framework MapKit -framework CoreLocation -lPods -Xlinker -dependency_info -Xlinker /Users/[username]/Developer/[AppName]/Build/Intermediates/[AppName].build/Debug-iphonesimulator/[AppName].build/Objects-normal/x86_64/[AppName]_dependency_info.dat -o /Users/[username]/Developer/[AppName]/Build/Products/Debug-iphonesimulator/[AppName].app/[AppName]

ld: library not found for -lPods-CMDQueryStringSerialization
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've uninstalled and reinstalled all the Cocoapods in the workspace several times to no avail. I've also seen so many other similar errors and done what those answers said to do, but I'm still getting the error.

Also, as a side note, earlier I was not getting this error but instead a '233 duplicate symbols for architecture x86_64' error pointing to some (read: a lot of) Objective-C files in some of the pods (i.e. ReactiveCocoa). It seems like these errors came after I added Facebook's Pop pod to my Podfile, but I'm not pointing any fingers because I'm pretty sure that didn't cause all these problems.

Please and thanks for any help!

EDIT: Here is the Podfile:

pod 'SimpleAuth/LinkedInWeb'
pod 'SimpleAuth/GoogleWeb'
pod 'pop', '~> 1.0'

inhibit_all_warnings!

UPDATE & FIX:

Ok, so I've fixed the problem. Here's what I did:

  1. Remove any pods that are causing the error.
  2. Delete Derived Data sub-folders.
  3. Remove any explicit '-lPods-[Pod]' linker flags in Build Settings -> Other Linker Flags.
  4. Quit/Restart Xcode.
  5. Add back pods and run pod install.
  6. Open .xcworkspace and build. Hopefully it should be fixed!

I'm not sure how necessary all of these steps are, but that's what I did to fix it for me.

L. Newman
  • 21
  • 5
  • Can you post the contents of your *Podfile*? Is `CMDQueryStringSerialization` in your Podfile? – der_michael Aug 24 '15 at 21:23
  • I updated the post. `CMDQueryStringSerialization` is a dependency of `SimpleAuth` I believe. – L. Newman Aug 24 '15 at 21:26
  • yeah, it lists `'ReactiveCocoa'` and `'CMDQueryStringSerialization'` as dependency. But for some reason your linker is not able to find the libraries... – der_michael Aug 24 '15 at 21:30
  • I've followed the #4 step of [Cocoapods Troubleshooting](https://guides.cocoapods.org/using/troubleshooting.html) which didn't help either. – L. Newman Aug 24 '15 at 21:34

1 Answers1

0

Add pod 'SimpleAuth' to your Podfile and run pod install, see if that helps.

der_michael
  • 3,151
  • 1
  • 24
  • 43
  • I'd try removing SimpleAuth altogether and re-adding it next. Together with removing the Derived Data Folder and restarting Xcode. http://stackoverflow.com/questions/18933321/deleting-contents-from-xcode-derived-data-folder – der_michael Aug 24 '15 at 21:36
  • 1
    I removed both SimpleAuth pods and tried again. Got the same error. Checked "Other Linker Flags", which had an explicit '-lPods-CMDQueryStringSerialization' flag. I removed that, built successfully. Quite Xcode, removed Derived Data folder, restarted Xcode. Re-added and reinstalled pods, and it built successfully again. Under "Other Linker Flags", it still shows '-lPods-CMD...' among others, but I think those are from $(inherited). So maybe it was the fact that they were explicitly listed there that was causing the problem. Anyway, I think I'm good now. Thanks so much for your help! – L. Newman Aug 24 '15 at 21:45