简体   繁体   中英

Xcode - 'library not found for -lPods-[Pod]'

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 (ie 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.

pod 'SimpleAuth'添加到Podfile并运行pod install ,看看是否有帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM