Search code examples
xcodemacosframeworksapple-tv

Wrong file path for an Xcode build product


I have an Xcode project with two framework targets for two different platforms (OS X and tvOS):

Targets
  + FrameworkOSX
  + FrameworkTVOS

This is meant to build a cross-platform framework. There are two corresponding products in the Products group:

Products
  + Framework
  + Framework

The Framework name appears twice here since both the frameworks have the same product name.

Now, the problem is that the path to the tvOS framework build product is wrong. Xcode says it’s Framework.framework relative to the build products folder, but in the build settings for the target the “Per-configuration Build Products Path” is set to the following:

$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

This means that the tvOS framework ends up somewhere here:

$(BUILD_DIR)/Debug-appletvos/Framework.framework

Whereas the appropriate framework icon in the Products group points to:

$(BUILD_DIR)/Framework.framework

…which is the OS X framework. And that means I have trouble linking with the tvOS framework later on. How can I make the product icon in the file tree point to the right build product?


Solution

  • It seems to have been some kind of glitch in Xcode (how I hate those!) since the issue went away when I re-created the Xcode project file.