Xcode 4.1.1 Crashes with Phonegap 2.0.0 and BarcodeScanner Plugin
-
27-06-2021 - |
문제
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!
해결책
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.