2014-01-16 119 views
2

我嘗試運行我的單元測試,我得到以下錯誤:庫沒有發現-lPods測試鐺當編譯單元測試

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

Ld /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProjectTests.xctest/MYIOSPROJProjectTests normal i386 
    cd /Users/AUSER/Documents/Dev/MYIOSPROJProject/MYIOSPROJProject 
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0 
    setenv 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 i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Intermediates/MYIOSPROJProject.build/Debug-iphonesimulator/MYIOSPROJProjectTests.build/Objects-normal/i386/MYIOSPROJProjectTests.LinkFileList -bundle_loader /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProject.app/MYIOSPROJProject -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework CFNetwork -framework CoreData -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework UIKit -framework Foundation -lPods-test -lPods-MYIOSPROJProjectTests -Xlinker -dependency_info -Xlinker /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Intermediates/MYIOSPROJProject.build/Debug-iphonesimulator/MYIOSPROJProjectTests.build/Objects-normal/i386/MYIOSPROJProjectTests_dependency_info.dat -o /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProjectTests.xctest/MYIOSPROJProjectTests 

正如有人誰是新的到iOS合法我不知道哪裏開始。任何指導將不勝感激(請詳細,因爲我是新的)。

波德文件:

platform :ios, 6.0 
pod 'RestKit', '~> 0.20.0rc' 

# Include optional Testing and Search components 
pod 'RestKit/Testing', '~> 0.20.0rc' 
pod 'RestKit/Search', '~> 0.20.0rc' 


target :IOSProjectTests do 
    pod 'Expecta',  '~> 0.2.3' # expecta matchers 
    # pod 'Specta',  '~> 0.1.11' # specta bdd framework 
end 
+0

您的podspec是否指定某些pod應該獨佔您的測試目標? –

+0

@JonReid上面添加了pod文件,我相信是的。 – Aziz

+0

雖然我在Podfile中發現問題,但我仍然可以在新項目中使用它。 –

回答

5

刪除-lPods測試文件,該文件是在項目和這個固定的問題。

這可以在文件夾導航區域的Frameworks目錄

+0

只是爲了澄清:我刪除了在xcode工作區導航器中的Pods> Products下找到的無關pod庫。 – hfossli

1

我已經多次有這個問題在過去的幾天中找到,並做一個CMD-SHIFT-OPTION-K清潔和終端能夠在每次修復它在我的項目目錄中重新運行pod install

0

重新啓動Xcode爲我解決了這個問題。 (在做任何事情之前值得一試。)