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

后端 未结 10 1573
-上瘾入骨i
-上瘾入骨i 2020-12-08 02:25

Am developing an existing iOS application and I have to write unit test cases for this project. It is building and running in Simulator 6.0. Whenever I try to test t

相关标签:
10条回答
  • 2020-12-08 02:47

    Create a new scheme. The bundle id / target name / executable / project name etc. are all slightly different concepts. If you change one (as I did) the old scheme may still be set to look for the old value as the name of the executable, while the build process may have been updated to no longer build that executable.

    0 讨论(0)
  • 2020-12-08 02:49

    In Xcode 11 select Product -> Scheme -> new Scheme

    this worked for me. Image

    0 讨论(0)
  • 2020-12-08 02:56

    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.

    0 讨论(0)
  • 2020-12-08 02:56

    The answer lies on your Build Settings > Library Search Paths entry. Make sure there are no fully qualified paths listed there. Decorate them with the $SRCROOT idiom and enclose the path with double quotes. If there are any escape backslashes make sure to remove them as well.

    Do a Clean and then Build and you should be back in business. This seem to be an issue with Xcode 5.x

    0 讨论(0)
  • 2020-12-08 02:58

    On xcode 6 you need to:

    1. go to products folder
    2. click on file .xctext
    3. on "TARGETS" choose Tests
    4. and on Host Application choose your application.
    5. Click build app.

    Works for me!

    0 讨论(0)
  • 2020-12-08 03:06

    Delete your scheme then re-create it (click new icon or using autocreate of xcode). It works for me.

    0 讨论(0)
提交回复
热议问题