title: Xcode 6 Error - "Missing Required Architecture i386" When Building for iOS Simulator
body: <p>I have created a custom Objective-C framework. I would like to import it into any given iOS project and use its provided functionality on both the iOS Simulator and an actual device. To import the framework, I link it using the <strong>Build Phases > Link Binary With Libraries</strong> setting in the app's target. I'm then able to import it into one of my classes with this statement:</p>
  
  <pre><code>#import &lt;CustomFramework/CustomFramework.h&gt;
  </code></pre>
  
  <p>I can instantiate my framework's classes just fine, but when I try to run my project on a device, I get the following error message:</p>
  
  <pre><code>dyld: Library not loaded: @rpath/CustomFramework.framework/CustomFramework
  Referenced from: /var/mobile/Applications/A61E882D-481A-4C0B-B4FD-69F5D24968BF/TestApp.app/TestApp
  Reason: image not found
  </code></pre>
  
  <p>And if I try to run it on the simulator, I get a different error message:</p>
  
  <pre><code>ld: warning: ignoring file /Users/user/Desktop/CustomFramework.framework/CustomFramework, missing required architecture i386 in file /Users/user/Desktop/CustomFramework.framework/CustomFramework (2 slices)
  Undefined symbols for architecture i386:
    "_OBJC_CLASS_$_CustomFramework", referenced from:
        objc-class-ref in AppDelegate.o
  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>This occurs when I instantiate a class from the framework. If I import the framework but don't actually use it, my app builds successfully. It just errors whenever I instantiate a class from the framework for some reason.</p>
  
  <p>To get the app to build on a device, I followed <a href="https://stackoverflow.com/questions/20092886/image-not-found-error-while-using-custom-framework/20095185#20095185">this</a> SO answer. Instead of linking the framework, I added a new Copy Files phase in the target's <strong>Build Phases</strong> setting, set the Destination to Framework, and added my framework.</p>
  
  <p>That works great; however, I'd like to test my app on the iOS Simulator as well. When I try to run my app on the simulator, I still get the "missing required architecture i386" error. I've tried the solutions proposed at just about every related SO topic I could find, and nothing has helped me resolve this issue.</p>
  
  <p>Please note that I am trying to use my custom framework in a new Xcode project, so none of the app/build settings have been changed from their defaults.</p>
  
  <p>How can I fix this error so that I can run my app on both the iOS Simulator and a device with my framework included in the project? Any insight would be greatly appreciated!</p>