【问题标题】:PhoneGap/Cordova Barcodescanner plugin for iPhone/iOSiPhone/iOS 的 PhoneGap/Cordova Barcodescanner 插件
【发布时间】:2012-06-28 23:42:58
【问题描述】:

我在 iPhone 上为 Phonegap 集成条形码扫描器插件时遇到了一些麻烦。我从这个 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)

当我尝试插件的测试项目时,我努力将它部署到 iphone,但是当我按下“扫描”时,我收到一个错误,即缺少 cordova-1.7.0.js 文件。我正在使用 xcode 4,并且在 xCode 上安装了 cordova 1.7.0。在网上我找不到解决方案或类似问题。

有什么想法吗?

【问题讨论】:

    标签: ios cordova phonegap-plugins barcode


    【解决方案1】:

    我更新到 xCode 4.3.3,然后错误消失了。也许错误是由于错误而发生的。插件仍然无法正常工作,但我认为这是另一个原因,不再与此问题相关。

    【讨论】:

    • 插件正在运行。我回到 phonegap 1.4.0,一切正常。
    【解决方案2】:

    根据https://groups.google.com/forum/?fromgroups#!topic/phonegap/D5R450L5kLI 的讨论,您可能已经完成了我刚才所做的事情。在您的目标设置的构建阶段下,有 2 组 Link Binary With Libraries。我正在添加到较低的空的。将所有库添加到上面的非空库修复它。

    【讨论】:

      【解决方案3】:

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

      AVFoundation.framework

      AssetsLibrary.framework

      CoreVideo.framework

      libiconv.dylib

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-03-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-09
        • 2017-07-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多