未找到Xcode库-lpods。 Clang:错误:链接器命令失败,退出代码为1

时间:2015-11-18 13:33:53

标签: ios xcode clang cocoapods linker-errors

我知道这是一个重复的问题,但我已经尝试过Stack Overflow中提供的解决方案,并注意到了帮助我。我正在通过pod添加MWPhotoBrowser并且它正在发生。我添加它的任何内容都会导致相同的错误。这是日志:

Ld /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/Objects-normal/i386/MyProj normal i386
    cd /Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -L/Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Products/Debug-iphonesimulator -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/Flurry -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/Vizury -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/Helpshift -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/Notiphi -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/GoogleAnalyticsV3.12 -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/src/libraries/Localytics-iOS-3.5.0 -L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/build/Debug-iphoneos -F/Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Products/Debug-iphonesimulator -F/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj -filelist /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/Objects-normal/i386/MyProj.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.0 -Xlinker -objc_abi_version -Xlinker 2 -all_load -ObjC -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -force_load -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a -Xlinker -add_ast_path -Xlinker /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/Objects-normal/i386/MyProj.swiftmodule -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/MyProj.app.xcent -framework WebKit -lAdIdAccess -lGoogleAnalyticsServices -framework CoreTelephony -framework MediaPlayer -framework CoreMotion -framework AssetsLibrary -framework AddressBook -framework Crashlytics -framework MobileAppTracker -lVizuryEventLogger -framework AdSupport -framework iAd -framework MobileCoreServices -lNotifyManager -weak_framework SystemConfiguration -weak_framework Security -weak-lz -weak-lsqlite3.0 -lFlurry_5.0.0 -lLocalytics -weak_framework CoreText -framework CoreLocation -framework CoreData -framework MessageUI -framework AVFoundation -framework AddressBookUI -framework QuartzCore -lHelpshift -framework CFNetwork -framework MapKit -framework GooglePlus -framework FacebookSDK -framework UIKit -framework Foundation -framework CoreGraphics -framework MobileDeepLinking -framework GoogleOpenSource -lPods -Xlinker -dependency_info -Xlinker /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/Objects-normal/i386/MyProj_dependency_info.dat -o /Users/vijaykas/Library/Developer/Xcode/DerivedData/MyProj-fxonghiiueuyuoeclquaxlqzofjh/Build/Intermediates/MyProj.build/Debug-iphonesimulator/MyProj.build/Objects-normal/i386/MyProj

Ld: warning: directory not found for option '-L/Users/vijaykas/MyProj/source/2015/Test/cf_re_ios_app/MyProj/build/Debug-iphoneos'
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

您必须打开 <YourProject>.xcworkspace而不是<YourProject>.xcodeproj

xcworkspace包含您的projectpods

您也可以按照以下步骤操作:

  • AppDevice卸载 Simulator
  • 确保关闭所有Xcode项目。 (.xcworkspace.xcproject)(有时.xcproject仍然开放)
  • 运行 pod installpod update
  • 打开 .xcworkspace
  • 清洁构建您的项目

之后你应该能够正常运行。