title: How to Include Cocoapods dependencies when exporting .framework?
body: <p>I have an Xcode workspace where I am building a framework, <code>MainFramework</code>. This framework uses Cocoapods with two dependencies, <code>SubFrameworkA</code> and <code>SubFrameworkB</code>. </p>
  
  <p>I would like to provide <code>MainFramework.framework</code> to other apps, without needing them to manually include <code>SubFrameworkA</code> and <code>SubFrameworkB</code> - or even better (but not necessary), also without them knowing that I've used these sub frameworks. I currently use <a href="https://github.com/gurhub/universal-framework/blob/master/universal.sh" rel="noreferrer">this post-archive script</a> to create a universal framework for simulators and devices.</p>
  
  <p>When I drag <code>MainFramework.framework</code> to a brand new <code>SampleApp</code> Xcode project, add it to "Frameworks, Libraries, and Embedded Content", and make sure it is set to "Embed &amp; Sign", the app crashes when it launches with this error:</p>
  
  <pre><code>dyld: Library not loaded: @rpath/SubFrameworkA.framework/SubFrameworkA
    Referenced from: /Users/dgcko/Library/Developer/CoreSimulator/Devices/092DD076-BB48-42B7-8D2A-166EE3A1F0D5/data/Containers/Bundle/Application/E1BA51D7-5F2F-4E0F-B88F-D3244AA934EB/SampleApp.app/Frameworks/MainFramework.framework/MainFramework
    Reason: image not found
  </code></pre>
  
  <p>What I've read:</p>
  
  <ul>
  <li><p>Creating an Umbrella framework is not recommended by Apple, as I do not own the sub frameworks.  And if SampleApp wants to use one of the SubFrameworks, there will be clashes as there will be two versions of the sub frameworks in their project (theirs and the one in MainFramework).</p>
  
  <ul>
  <li><p><a href="https://github.com/CocoaPods/CocoaPods/issues/8656" rel="noreferrer">According to this issue</a>, it doesn't seem possible as the SubFrameworks are dynamically linked.</p></li>
  <li><p><a href="https://stackoverflow.com/a/37189340/13680087">This answer</a> also seems to suggest the same - SampleApp needs to also manually include the sub frameworks.</p></li>
  </ul></li>
  </ul>
  
  <p>Does anybody know if what I am trying to do is possible, somehow? Any help would be much appreciated.</p>