title: Embedding XCFramework in application with project framework dependencies
body: <p>I have an Xcode workspace which features a project with an iOS Application target, and another project with a Framework target. The framework target is dependent on another framework, which is integrated in the form of an <code>xcframework</code>:</p>
  <ul>
  <li>MyApp</li>
  <li>MyFramework</li>
  <li>OtherFramework</li>
  </ul>
  <p>Using regular <code>OtherFramework.framework</code> would require it to be linked to <code>MyFramework</code> and then embedded in <code>MyApp</code> even though <code>MyApp</code> doesn't require the framework itself. However when integrating with <code>xcframework</code>, this project then fails to build with a <code>No such module 'OtherFramework'</code> error.</p>
  <p>Project settings:</p>
  <p><a href="https://i.stack.imgur.com/Ts0Vi.jpg" rel="noreferrer">MyFramework Project</a></p>
  <p><a href="https://i.stack.imgur.com/qcJK8.jpg" rel="noreferrer">MyApp Project</a></p>
  <p>Removing <code>OtherFramework.xcframework</code> from the <code>MyApp</code> target fixes the build issue, but then causes <code>library not loaded</code> errors as the framework is not present in the application.</p>
  <p>Demo project here: <a href="https://github.com/msaps/XCFramework-Link-Issue" rel="noreferrer">https://github.com/msaps/XCFramework-Link-Issue</a></p>
  <p>How are you meant to link an <code>xcframework</code> in an application and link in a dependent framework?</p>
  <h1>Why?</h1>
  <p><a href="https://github.com/pyckamil" rel="noreferrer">pyckamil</a> just posted this article which explains the issue in detail: <a href="https://pyckamil.github.io/programming,/xcframework,/xcode/2020/05/09/everything-wrong-with-xcframeworks.html" rel="noreferrer">Everything wrong with XCFrameworks</a>.</p>
  <p>It turns out Xcode has an optimisation for the <code>ProcessXCFrameworkLibrary</code> step which extracts the correct <code>.framework</code> from an <code>.xcframework</code> for the active build architecture. This is only run once which causes issues for additional targets that try to link the same framework.</p>
  <h1>Update</h1>
  <p><strong>This issue is resolved in Xcode 12.0</strong></p>