适用于iPhone/iOS的PhoneGap/Cordova Barcodescanner插件

Chr*_*ris 1 barcode ios phonegap-plugins cordova

我在iPhone上为Phonegap集成了一个barcodescanner-plugin时遇到了麻烦.我从这个github存储库获取了我的插件:

https://github.com/phonegap/phonegap-plugins/

我按照说明中的所有步骤操作,包括将所有相关源添加到项目的构建路径的步骤.我也关闭了自动引用计数.我认为每个文件都在正确的位置,但无论如何我遇到了这个错误:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
  objc-class-ref in CDVBarcodeScanner.o
  "_CVPixelBufferGetBytesPerRow", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
  "_CVPixelBufferUnlockBaseAddress", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
  "_CVPixelBufferGetHeight", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
  -[CDVbcsProcessor setUpCaptureSession] in CDVBarcodeScanner.o
  "_CVPixelBufferGetBaseAddress", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
  "_CVPixelBufferLockBaseAddress", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
  "_CVPixelBufferGetWidth", referenced from:
  -[CDVbcsProcessor getLuminanceSourceFromSample:imageBytes:] in CDVBarcodeScanner.o
  -[CDVbcsProcessor getImageFromSample:] in CDVBarcodeScanner.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

当我尝试插件的测试项目时,我会将其部署到iphone,但是当我按下"scan"时,我收到一个错误,即cordova-1.7.0.js文件丢失了.我在xCode上安装了xcode 4和cordova 1.7.0.在网络上我找不到解决方案或类似的问题.

有任何想法吗?

Aba*_*art 8

将以下库添加到Xcode项目中:

AVFoundation.framework

AssetsLibrary.framework

CoreVideo.framework

libiconv.dylib

选择目标,然后显示"构建阶段".在Link Binary With Libraries下,单击添加按钮,然后选择上面的框架.

以粗体列出的库是导致此错误发生的原因.这是https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner上的说明摘录