This one looks like a bug in Xcode 7.1.1.  It was fixed in Xcode 7.2, but I’m writing it up anyway because the answer was not easy to find.

We were adding a new embedded framework to an app recently. It built on the local Mac just fine, but it failed to build on Jenkins. In fact, Jenkins kept reporting that it failed to build the sub-project’s scheme named “Mac OS X”.  But it was only intended to build the iOS scheme.

At first it seemed like a problem with Jenkins.  We could build the the project just find on Xcode on a developer’s Mac.  But then we found we could reproduce the problem by using xcodebuild in the terminal.

After a lot of aggravation, it turned out to be a problem with Xcode 7.1.x when more than one build product has the same name.  Our sub-project was set to build a framework for either Mac OS X or for iOS.  Both of them had the same name, like “myProject.framework”.

When adding a new embedded framework in the project’s “General” tab, in the “Embedded Frameworks” section with the “+” button, Xcode would see the 2 products of the subproject with the same name and nicely add “Mac” and “iOS” in gray letters.  Unfortunately, Xcode got them exactly backwards. Read the rest of this entry »