Comments (14)
  • Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

1 Gilbert_Liao commented Permalink

Thanks for your detailed tutorial. I followed your steps to test BarcodeScanner plugin, but got following error while clicked the barcode image. Do you have any idea or clue of this error? Thanks !
2013-02-27 22:24:39.985 BarcodeScanner[4858:c07] [LOG] calling cordova barcodeScanner!!
2013-02-27 22:24:39.992 BarcodeScanner[4858:c07] -[NSNull count]: unrecognized selector sent to instance 0x3ec2678
2013-02-27 22:24:40.066 BarcodeScanner[4858:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x3ec2678'
*** First throw call stack:
(0x3d91012 0x2c6ae7e 0x3e1c4bd 0x3d80bbc 0x3d8094e 0x3d6edeb 0x271961 0x2c698e 0x2c6237 0x2c5e2d 0x2c5f8c 0x2c5ed3 0x2c7e6b0 0xa43035 0x3d14f3f 0x3d14a39 0x3d37734 0x3d36f44 0x3d36e1b 0x35c67e3 0x35c6668 0xddf65c 0x3196 0x30c5 0x1)
libc++abi.dylib: terminate called throwing an exception

2 deepuev commented Permalink

i am also getting the same error as bcliao

3 timdp commented Permalink

Hi! The fact you've pasted the log file and said "clicked the barcode image" suggest to me that you're using the iOS simulator? Can you confirm please?

From the end of section 3: "You should now be in a position to try this out on your device. Note that you can't test the app in the iOS simulator, as the camera isn't simulated."

4 deepuev commented Permalink

I tried on device . below is the device crash log from device .

Last Exception Backtrace:
0 CoreFoundation 0x3410a3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3be0595e objc_exception_throw + 26
2 CoreFoundation 0x3410df2c -[NSObject(NSObject) doesNotRecognizeSelector:] + 180
3 CoreFoundation 0x3410c648 ___forwarding___ + 388
4 CoreFoundation 0x34064204 _CF_forwarding_prep_0 + 20
5 CoreFoundation 0x3406881c +[NSArray arrayWithArray:] + 40
6 InStoreApp 0x001a5458 -[CDVInvokedUrlCommand legacyArguments:andDict:] + 56
7 InStoreApp 0x001cfb36 -[CDVCommandQueue execute:] + 446
8 InStoreApp 0x001cf898 -[CDVCommandQueue executePending] + 456
9 InStoreApp 0x001cf5f0 -[CDVCommandQueue enqueCommandBatch:] + 80
10 InStoreApp 0x001cf6c2 -[CDVCommandQueue fetchCommandsFromJs] + 102
11 InStoreApp 0x001cf64c -[CDVCommandQueue maybeFetchCommandsFromJs:] + 80
12 Foundation 0x34a2249c __NSThreadPerformPerform + 456
14 CoreFoundation 0x340df158 __CFRunLoopDoSources0 + 208
15 CoreFoundation 0x340ddf2a __CFRunLoopRun + 642
16 CoreFoundation 0x34051238 CFRunLoopRunSpecific + 352
17 CoreFoundation 0x340510c4 CFRunLoopRunInMode + 100
18 GraphicsServices 0x37c30336 GSEventRunModal + 70
19 UIKit 0x35f6d2b4 UIApplicationMain + 1116
20 InStoreApp 0x000c2c16 main (main.m:21)
21 libdyld.dylib 0x3c232b1c start + 0

5 deepuev commented Permalink

It was my mistake . when i passed ["scannerOverlay"] , then it started working . Thank you ......

Deepak E V

6 JigneshSampat(ISL) commented Permalink

Thanks for the detailed tutorial.
I followed everything. But on click of the image nothing is happening.
I m using WL506.
I have updated the config.xml also.

7 David Whitehouse commented Permalink

Thanks for the step-by-step instructions. One thing to note is that in Worklight Version 6 there is no Cordova.plist file. The configuration has moved into config.xml in the top level of the native folder. Just add the following line under the other cordova plugins.

<plugin name="org.apache.cordova.barcodeScanner" value="CDVBarcodeScanner" />

8 timdp commented Permalink

Thanks David, I've added a pointer to the comments at the top of the tutorial for people using Worklight 6.

9 Kriersd commented Permalink

If your using Worklight V6.0.0 here are some things you need to be aware of.

Make sure you are using the right version of the Plugin (downloaded from GitHub). It must be compatible with Cordova 2.6, which is what Worklight v6.0.0 uses under the covers. DO NOT USE the 3.0 version.
There is a bug in Cordova 2.6 that will prevent you from compiling in Xcode. You need to apply this patch to the Cordova lib (CDVPlugin.h) code.
Replace these 4 lines
NSString* const CDVPageDidLoadNotification;
NSString* const CDVPluginHandleOpenURLNotification;
NSString* const CDVPluginResetNotification;
NSString* const CDVLocalNotification;
with this
extern NSString* const CDVPageDidLoadNotification;
extern NSString* const CDVPluginHandleOpenURLNotification;
extern NSString* const CDVPluginResetNotification;
extern NSString* const CDVLocalNotification;

10 Kriersd commented Permalink

here is the link that explains the bug in Cordova 2.6