.app file not found in Derived Data

dwf picture dwf · Apr 9, 2013 · Viewed 16.9k times · Source

When trying to compile my project I am getting this error and am wondering if anyone knows how to fix it?

I've read every answer on SO and elsewhere on the internet pertaining to this kind of linker error. I've tried so many solutions, including the very popular --delete derived data in xcode, quit xcode completely, delete it again on the command line and then restart xcode-- still nothing. This started after I tried to attach a device to my computer (which I've since deleted from the organizer) that was a friends to try to run it on his iPad. I'm at my wits end and can't afford to waste anymore time on this. Any ideas on how to fix it?

The app file in the Products folder is red.

EDIT: More info: The actual app is not being built and put in the Library/Developer/{app}/Build/Product folder. I've tried reconnecting the device and adding the provision profile manually from the apple website, then trying to Build->Archive the app while the device is selected. I still get the error. I've tried changing from debug to release in the Schemes and doing all of that, I still get the error. I tried uninstalling xcode and reinstalling it, deleting the app completely off the computer (including the derived data) pulling back down from Git and I get the same error.

Ld /Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator/UnitTests.octest/UnitTests normal i386     cd /Users/mischabuckler/Desktop/Git/TRx     setenv IPHONEOS_DEPLOYMENT_TARGET 6.1     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/iPhoneSimulator6.1.sdk -L/Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator -F/Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Intermediates/TRx.build/Debug-iphonesimulator/UnitTests.build/Objects-normal/i386/UnitTests.LinkFileList -bundle_loader /Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator/TRx.app/TRx -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -framework SenTestingKit -framework UIKit -framework Foundation -o /Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator/UnitTests.octest/UnitTests

ld: file not found: /Users/mischabuckler/Library/Developer/Xcode/DerivedData/TRx-clxlusutxvcrlkddtqwtoxibcmhc/Build/Products/Debug-iphonesimulator/TRx.app/TRx clang: error: linker command failed with exit code 1 (use -v to see invocation)

Answer

ninjaneer picture ninjaneer · Oct 13, 2014

This happens when you rename the main target, and the test target hasn't been updated. Check the build settings in the test target and make sure the paths are pointing to the new folders. For example, if you renamed the target SuperAwesome to just Super, your test target is expecting files in SuperAwesome.app/ folder when it should be updated to Super.app/