1

Upon "Adding Files to Project ..." within Xcode that are either .mm or .cpp, Xcode pauses then crashes.

I have Xcode 4.4.1 installed with Phonegap 2.0.0 properly setup. I am using the Phonegap BarcodeScanner plugin from this master repo:

https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner

I changed the compiler from Apple LLVM 4.0 to LLVM GCC 4.2 through Xcode -> (Target Build) -> Build Settings -> Build Options -> Compiler for C/C++/Objective-C.

The following Frameworks are also added properly:

  • AVFoundation.framework
  • AssetsLibrary.framework
  • CoreVideo.framework
  • libiconv.dylib

There are 4 files that are required for the BarcodeScanner to function properly:

  • barcodescanner.js
  • CDVBarcodeScanner.mm
  • zxing-all-in-one.cpp
  • zxing-all-in-one.h

Upon adding the "zxing-all-in-one.h" file to my plugins folder and "barcodescanner.js" to the www/ directory, everything is fine. It's only when adding the .mm or .cpp files that Xcode crashes.

I have another MacBook Pro running Phonegap 1.7.0 and Xcode 4.4 and the barcode scanner works fine. What's happened in Phonegap 2.0.0 that is crashing? I looked through the FAQs and README documentation but couldn't find anything that worked. Thanks for the help!

ninu
  • 890
  • 2
  • 10
  • 26

1 Answers1

1

Sounds like a bug in your specific version of Xcode.

Works perfectly fine for me in Xcode 4.3.2. Try downloading an older version of Xcode or the latest beta.

Levi
  • 2,103
  • 14
  • 9
  • 1
    Everyone, Levi and I tried both 4.4.1 and 4.4 and the former crashes with any C++ based file. If you're using Phonegap 2.0.0 make sure to have Xcode 4.4 installed. We're assuming anything from 4.3.2 -> 4.4 will work. – ninu Aug 19 '12 at 21:30