.app file not found in Derived Data

强颜欢笑 提交于 2019-12-03 11:23:21

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/

Ok, the clue, while difficult to spot, is that the message you posted above isn't one building your app, but your unit tests. It also mentions it at the top of your output window, but one doesn't expect that to change.

You've possibly renamed your scheme, and in doing so the unit test is pointing to your real build or something else. Your app may well actually have built fine, but its your unit test target that fails.

If the problem is that you've been renaming targets then in your UnitTest scheme, go to build settings and search for TEST, which should bring up the settings for TEST HOST. Make sure these values are pointing to whatever you want the test app to be called and not the main executable.

For me it was just a case of appending "test" onto both the debug & release setting of my test target's TEST_HOST.

It all builds for me now, though annoyingly it is actually building both targets - at least they both compile.

So for anyone else who finds this and is frustrated what I ended up doing was deleting the target dependencies for both my app and the unit tests and then building the app once, then re-adding them and building the app again, and it worked fine.

Try duplicating the target, and run using the target's copy.

I hate Mach-o linker errors, its frustrating, anyway, I faced the same issue by creating a new scheme, it worked like magic for me.

Go to Project -- > Build Settings --> Testing --> Test Host Remove all the paths in Test Host, and do a clean build.

Try to run Clean and then Build/Run the project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!