title: How to build Cocoa Touch Framework for i386 and x86_64 architecture?
body: <p>After building a Cocoa Touch framework (Swift or Object-C) and adding it to another project as "Embedded Binaries" I get the following error message when I try to build</p>
  
  <pre><code>missing required architecture i386
  ...
  ld: symbol(s) not found for architecture i386
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>Following various existing answers and extended research I already added <strong>i386</strong> to the <strong>Architectures</strong> build settings …</p>
  
  <p><img src="https://i.stack.imgur.com/Hkf9V.png" alt="enter image description here"></p>
  
  <p>However this doesn't seem to have an effect. When I check using</p>
  
  <pre><code>lipo -info TesterFrameworkObjC
  </code></pre>
  
  <p>I only get </p>
  
  <pre><code>Architectures in the fat file: TesterFrameworkObjC are: armv7 arm64
  </code></pre>
  
  <p>… shouldn't i386 (and x86_64) appear here as well? What am I missing? </p>
  
  <p>(I am using Xcode 6.2 + building for iOS 8.2)</p>
  
  <hr>
  
  <h1>Some new insights</h1>
  
  <p>Using a version of this <a href="https://gist.github.com/Tokuriku/96fe6f92e6f2abb87906" rel="noreferrer">build script</a> I am able to build the missing architectures for the Swift version of the framework.</p>
  
  <p><img src="https://i.stack.imgur.com/pwopM.png" alt="enter image description here"></p>
  
  <p>However when I add this framework to my app and build I still get errors </p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_OBJC_CLASS_$__TtC20TesterFrameworkSwift18TestFrameworkSwift", referenced from:
    objc-class-ref in ViewController.o
  ld: symbol(s) not found for architecture x86_64
  </code></pre>
  
  <p>Looking at the final build folder building for the simulator</p>
  
  <pre><code>Build/Products/Debug-iphoneos/TesterFrameworkSwift.framework/
  </code></pre>
  
  <p>I can see that the architectures are still missing although they were part of the framework (as shown). How can I ensure all the right architecture builds of my framework are included when building the app?</p>
  
  <hr>
  
  <h3>Update</h3>
  
  <p>Looking at all the error messages to me it looks like the issue isn't actually to have the wrong products/archictures being built but one step later there the <strong>Linker</strong> isn't using the correct paths to them. Not sure how correct this.</p>