“File not found”, “linker command failed with exit code 1” in Xcode 4.5.1 “File not found”, “linker command failed with exit code 1” in Xcode 4.5.1 ios ios

“File not found”, “linker command failed with exit code 1” in Xcode 4.5.1


Steps to resolve:

  1. Create new scheme with different name
  2. Delete old scheme

  3. Add new scheme

Where the problem came from:

I changed my product name and disabled the snapshot option. Then, suddenly, this error popped out:

ld: file not found:.././previousproductname.app/previousproductname

Steps I followed unsuccessfully to debug:

  1. Deleted deriveddata, restarted Xcode. - not resolved.

  2. Followed the steps of this: link http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ - same error; not resolved.

  3. Finally, I changed the Scheme name, deleted my old scheme and added new, have solved my issue.


I encountered the same error message. Turned out I had renamed my app target and had not updated the test target, Build Settings, Bundle Loader setting to my new app name.

More details on this setting can be found at Adding Unit Tests to an existing iOS project with Xcode 4 I reviewed the same steps and it helped me fix my project in Xcode 5.


You must have changed your product name. Due to mis-match of your workspace name and product(application)name this error occurs.

You just need to replace the workspace name to product(application) name in the TEST HOST Build settings of the ProjectName-Tests targe as stated in the image. To catch up that, select to ProjectName-Tests target, select Build Settings, search for the Test Host term.

enter image description here

This is the standard configuration solution for this error.

Cheers!!