title: iPhone Build fails - XCode 5.1.1 iOS 7
body: <p>I've followed this bar code scanner tutorial <a href="http://rdcworld-iphone.blogspot.com.au/2013/03/how-to-use-barcode-scanner-br-and-qr-in.html" rel="nofollow">http://rdcworld-iphone.blogspot.com.au/2013/03/how-to-use-barcode-scanner-br-and-qr-in.html</a> which runs fine in the simulator. However it says "Build Failed" when I connect my iPhone and attempt to build it. There are no errors. My phone version is 7.1.2 if that helps.</p>
  
  <p>What process should I follow to find what the cause/s of the failure are?</p>
  
  <p>Edit:</p>
  
  <p>I am not using an _ or space in the project name.</p>
  
  <p>Edit:</p>
  
  <p>Error log for iPhone:</p>
  
  <pre><code>ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a file '/Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a' for architecture armv7s
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>The error log for iPhone 4 64 bit simulator:</p>
  
  <pre><code>ld: warning: ignoring file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a, missing required architecture x86_64 in file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a (3 slices)
  Undefined symbols for architecture x86_64:
    "_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
        objc-class-ref in ViewController.o
    "_ZBarReaderControllerResults", referenced from:
        -[ViewController imagePickerController:didFinishPickingMediaWithInfo:] in ViewController.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
  (null): Ignoring file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a, missing required architecture x86_64 in file /Users/airefrig/Documents/BarcodeScannerDemo/BarcodeScannerDemo/ZBarSDK/libzbar.a (3 slices)
  
  (null): "_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
  
  (null): Objc-class-ref in ViewController.o
  
  (null): "_ZBarReaderControllerResults", referenced from:
  
  (null): -[ViewController imagePickerController:didFinishPickingMediaWithInfo:] in ViewController.o
  
  (null): Symbol(s) not found for architecture x86_64
  
  (null): Linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>Edit:
  I've got it to work fine on the iPhone by downloading and using the latest zbar sdk framework. Now however the simulator doesn't build as it wants the old one! </p>
  
  <p>Anyone have an idea how to make both the phone and simulator happy?</p>
  
  <p>Edit 2:</p>
  
  <p>I got it working use the old libraries, but not the latest which is what I have to do for work. For the old libraries I did the following:</p>
  
  <p>1) Create a new app and make it universal.
  2) Follow the normal tutorial steps except use a storyboard not a xib file and set the project to use that for both iphone and ipad. Also don't put in the code near the end of the tute which specifies which Xib to use since I'm not using one!
  3) In build settings set the Architectures and Valid Architectures to "armv7"
  4) In build settings set Build Active architecture only to YES</p>
  
  <p>What I've done just recently is to remove the old ZBar libraries and replace them which these  <a href="http://www.nerdvision.net/app-development/ios/zbar-sdk" rel="nofollow">http://www.nerdvision.net/app-development/ios/zbar-sdk</a></p>
  
  <p>It gives me this error though:</p>
  
  <pre><code>ld: warning: ignoring file /blahblah/BarcodeScannerNew/BarcodeScannerNew/zbar_iOS7_Fix/libzbar.a, missing required architecture i386 in file /blahblah/BarcodeScannerNew/BarcodeScannerNew/zbar_iOS7_Fix/libzbar.a (3 slices)
  
  Undefined symbols for architecture i386:
  
    "_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
  
        objc-class-ref in AACsViewController.o
  
    "_ZBarReaderControllerResults", referenced from:
  
        -[AACsViewController imagePickerController:didFinishPickingMediaWithInfo:] in AACsViewController.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>I think what that means is it wants the old (I presume 32 bit) libraries, not the latest ones. Not sure how to fix it though as I can't include both old and new Zbar files because it gives an error about duplicate files.</p>