1
votes

I'm stuck with some trouble integrating a barcodescanner-plugin for Phonegap on a iPhone. I got my Plugin from this github repository:

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

I followed all the steps in the instructions, including the step to add all related sources to the build path of the project. Also i turned off automatic reference counting. I think every file is in its right place, but anyways I'am experiencing this error:

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)

When I try the test project of the plugin I works to deploy it to the iphone but as I press "scan" I get an error that the cordova-1.7.0.js file is missing. I'm using xcode 4 and cordova 1.7.0 is installed on xCode. In the web I cant find a solution or similar problem.

Any ideas?

3

3 Answers

8
votes

Add the following libraries to your Xcode project:

AVFoundation.framework

AssetsLibrary.framework

CoreVideo.framework

libiconv.dylib

Select your target, and then display the Build Phases. Under Link Binary With Libraries, click the add button and then select the frameworks above.

The libraries listed in bold are what are causing this error to occur. This is an excerpt from the instructions found at https://github.com/phonegap/phonegap-plugins/tree/master/iOS/BarcodeScanner

0
votes

I updated to xCode 4.3.3 and then the errors disappeard. Maybe the errors occoured due to a bug. Plugin is still not working but I think this is for another reason and not connected to this issue anymore.

0
votes

According to a discussion at https://groups.google.com/forum/?fromgroups#!topic/phonegap/D5R450L5kLI you may have done what I just did. Under Build Phases for your Target Settings there are 2 groups of Link Binary With Libraries. I was adding to the lower empty one. Adding all the libraries to the upper not-empty one fixed it.