2014-10-31 37 views
10

重命名我的項目,每當我試圖構建應用程序,我得到一個 蘋果Mach-O的連接錯誤下面 後在Xcode本身Xcode的蘋果Mach-O的連接錯誤1

Ld /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/Broadcast!Tests.xctest/Broadcast!Tests normal x86_64 
    cd "/Users/joshevans/Desktop/sn app/SwifferApp" 
    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 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk 
-L/Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator 
-F/Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator 
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks 
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks 
-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks 
-filelist /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast!Tests.LinkFileList 
-Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -bundle_loader /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/SwifferApp.app/SwifferApp 
-Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator 
-Xlinker -add_ast_path -Xlinker /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast_Tests.swiftmodule 
-mios-simulator-version-min=8.0 -Xlinker -dependency_info -Xlinker /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Intermediates/Broadcast!.build/Debug-iphonesimulator/Broadcast!Tests.build/Objects-normal/x86_64/Broadcast!Tests_dependency_info.dat 
-o /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/Broadcast!Tests.xctest/Broadcast!Tests ld: file not found: /Users/joshevans/Library/Developer/Xcode/DerivedData/Broadcast!-gbvxmzbukuqqgxcmlipegtnzosze/Build/Products/Debug-iphonesimulator/SwifferApp.app/SwifferApp clang: error: linker command failed with exit code 1 (use -v to see invocation) 

感謝輸出爲您提供幫助,因爲我是Xcode和swift語言的新手。 Josh

+0

Clang建議使用-v來查看調用。你嘗試過嗎? – johnnieb 2014-10-31 00:25:04

+0

我是Xcode的新手,最好的辦法是做什麼? – josh2205 2014-10-31 01:02:13

+0

您的項目名稱是否包含感嘆號? – Acey 2014-10-31 01:20:47

回答

0

我偶爾在嘗試實施AdMob廣告時得到了Apple Mach-O Linker Error 1。我處理它的方式是首先進入我的應用程序的構建設置並找到「庫搜索路徑」並清除所有搜索路徑。然後,我重新將AdMob文件夾添加到項目中,並且錯誤消失。

現在顯然你的情況有點不同。就我個人而言,我會將文件重命名爲以前的名稱。如果錯誤仍然存​​在,請清除庫搜索路徑。仍然是一個錯誤?當我不斷收到錯誤信息時,我做了一個新的Xcode項目,其中包含我想要的名稱,然後將所有文件複製到新項目中。這是一個簡單的過程,尤其是如果你是初學者,它可能不會花太長時間。我希望這有幫助!

34

重命名後,就到你的項目文件(在那裏你會看到標籤:常規,能力,信息等)

,並選擇YourAppTests在左側

enter image description here

您的列表可能會看到這張圖片 enter image description here

將主機應用程序設置爲您的項目名稱,就是這樣。

+2

這對我有效,謝謝! – Trapp 2015-02-11 22:28:20

+2

非常感謝!我不知道它是如何進入這個狀態的。 – 2015-02-25 00:24:00

+2

拯救生命!重命名後,我有這個並根據你的指示改變完美!非常感謝你。 Mine在xcode 6上設置爲自定義,並更改爲新名稱 - 完美。 – ZipNFC 2015-04-07 15:10:53

相關問題