title: Xcode Shared Framework Linking Issue In Multi-Target Project
body: <p>We have an Xcode project with many app targets, e.g.:</p>
  <ul>
  <li>Target <code>A</code> depends on the shared framework <code>Airship</code></li>
  <li>Target <code>B</code> does not depend on any framework</li>
  </ul>
  <p>The problem is that when I compile <code>A</code> first the Airship framework is is already copied/built into the derived data folder and also in the app <code>A</code>.</p>
  <p>When I then compile <code>B</code> (Xcode chooses the same derived data folder) Xcode writes this framework for whatever reason in the linked frameworks of the binary. <code>otool -L</code> result:</p>
  <pre><code>@rpath/Airship.framework/Airship (compatibility version 1.0.0, current version 1.0.0)
  </code></pre>
  <p>At the same time Airship is not copied to the app package's Frameworks directory since we don't reference it in that target. <strong>Of course the app crashes on run...</strong></p>
  <p>Is this maybe a known Xcode bug? Xcode should not reference frameworks <strong>not linked</strong> to a target inside the resulting binary...</p>
  <p>I already tried to reference the framework as optional in <strong>every</strong> app target which builds and does not crash  <strong>but</strong> when I submit this to the App Store I get the warning from the screenshot below...</p>
  <p><a href="https://i.stack.imgur.com/NWJQj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NWJQj.png" alt="from this screenhot" /></a></p>