7

In addition to the standard "Release" and "Debug" configurations, an app I develop has an "Adhoc" configuration, used for ad-hoc testing builds. The frameworks built alongside it in the workspace do not have this configuration, because their behavior is not customized for ad-hoc builds. Therefore, when the workspace builds for ad-hoc, the products are separated into:

  • $BUILT_PRODUCTS_DIR (which has an Adhoc prefix)
  • $BUILT_PRODUCTS_DIR/../Release-iphoneos or $BUILT_PRODUCTS_DIR/../Release-iphonesimulator, depending on which we are currently building for.

It's easy enough to get this working with library and framework search paths, by adding $(BUILT_PRODUCTS_DIR)/../Release-$(PLATFORM_NAME) to those settings. At this point, my app builds correctly, but fails on the "Embed Frameworks" step.

My frameworks are added to the app project with the location BUILT_PRODUCTS_DIR and a relative path of just their name.

This question is similar, but it only works for static libraries, which do not require this step - I'm using frameworks.

If there is a better way to handle this, please let me know - but I don't want to push the custom configuration upwards into the frameworks, because some of them may be eventually be open-sourced, and details of our internal process are irrelevant in that case.

  • Why does the Ad-Hoc setup need to be any different than Release? The only thing that might change is you might use a different signing profile? – sschale Feb 29 '16 at 22:21
  • Including the HockeyApp framework, `#if` code for setting that up, dev-only features, etc. –  Feb 29 '16 at 22:25
  • Will this [this](http://stackoverflow.com/questions/8523690/xcode-custom-build-configuration-causes-library-file-not-found-for-static-libr) help? – J.Wang Mar 01 '16 at 01:18
  • No - that is for static libraries. I have vaguely solved this by adding a script that checks the configuration and does `cp -R "$(BUILT_PRODUCTS_DIR)/../Release-$(PLATFORM_NAME)"/*.framework "$(BUILT_PRODUCTS_DIR)"`, and it works, but I'm not sure that it's really _correct_. –  Mar 01 '16 at 05:08
  • I used the same script. Not sure if it is correct, but it works. – Tim Sneed Sep 21 '18 at 12:24

1 Answers1

0

I had a similar problem in one of my apps. In Xcode 12.4 I was able to solve it by setting the System Framework Search Paths for my Ad Hoc configuration to $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME).

This setting can be found in your project by selecting your Target and then the Build Settings tab. I suggest searching for "System Framework" to find it. Once you add the path, Xcode will translate it to the actual path on your system, as seen in my screenshot.

Build Settings Example

Mario Hendricks
  • 727
  • 8
  • 7