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

后端 未结 10 1574
-上瘾入骨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 03:07

    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.

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

    Your linker is looking for a file at: /Users/Yuva/Library/Developer/Xcode/DerivedData/FlyApp-aexukpgtbathuadgxlnm/Build/Products/Debug-iphonesimulator/FlyApp.app/FlyApp

    Did you follow the path to ascertain if the file is there? Note that FlyApp.app is probably a package and you'll have to "see package contents" if you're viewing from the Finder. If it's not there, either 1) you need to build FlyApp.app first, or 2) you have something in your test code that depends on it being there, which can't be determined from your question.

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

    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!!

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

    ARGH! This is a terribly frustrating issue that came out of the blue from my XCode 8.2

    In my case it came down to removing my Tests target from the scheme, building and running the main app, then readding the Tests target to the 'Test' section.

    It appears that the Tests target was trying to find something it wanted in the Derived Data which wasn't built yet. Running the app without trying to build tests too allowed the previously missing derived data to be prepared.

    ...Insanity is doing the same thing in XCode twice and expecting the same result :|

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