Since this has stumped me at least twice now, wasting over an hour each time trying to work out what the solution is, I decided to write it down.

If you have a Xcode workspace with a couple of projects in it, how do you add targets of one project (project 1) to be dependencies of a target in a different project (project 2) all within the same workspace. The answer is that you add the dependencies in the scheme editor associated with the target in project 2, you do this in the Build action section of the scheme editor. The find implicit dependencies option in the scheme editor doesn’t always work across projects. Whatever the setting for the implicit dependency option, I like to make my dependencies explicit.

I added the products which belong to project 1 to project 2 for inclusion in the application bundle, but the copy files build phase didn’t find them. Two changes were necessary for the project 1 products to be found by the project 2 target build. I had to get the build order of the dependencies and the final product correct in the scheme editor, and secondly I had to change the path for project 1 build products to be relative to the group. I don’t know why the copy files build phase couldn’t find the project 1 build products before making this change. But after making these changes it worked.

Tags: , , , ,