2

I am trying to scan the barcode in the current project for ios. For that i used the Phone Gap plugin. I followed the link to add the files properly: Barcode Link

I added the barcodescanner.js file inside www folder of my project. But when i am pressing the button to scan the barcode in ipad 2, it is giving the below error:

  ERROR: Plugin 
'org.apache.cordova.barcodeScanner' not found, or is not a CDVPlugin. 
Check your plugin mapping in Cordova.plist

It seems it is not getting the proper path of the barcodescanner.js file. I added the path in the index.html file also properly.

Can anyone please help??

Arindam Mukherjee
  • 2,255
  • 11
  • 48
  • 83

1 Answers1

3

Arindam,

I got it working now. What I did

  1. Change the Key in the Cordova.plist as they did in the link
  2. Change the code of the barcodescanner.js as the did in the same link as above
  3. Added the .cpp , .h and .mm files not only to the Folder in my workspace directory, but also added them to my xcode project:

Right Click on "Plugins" -> Add Files To projectname -> Select the .cpp , .h and .mm file from my Plugins folder in the project Directory -> Set "Create Folder references for any added folders" and "add to Target projectname" -> Click "Add"

After adding the files to my project, the scanner worked.

hope that also solves it for you. I`m using Cordova 1.8.1 tho.

Community
  • 1
  • 1
最白目
  • 3,505
  • 6
  • 59
  • 114
  • you mentioned: Added the .cpp , .h and .mm files not only to the Folder in my workspace directory, but also added them to my xcode project. What is this mean. I added those files in plugins as you told..but still it is not working. – Arindam Mukherjee Aug 21 '12 at 11:56
  • do i have to add the js file also inside plugins folder?? – Arindam Mukherjee Aug 21 '12 at 12:01
  • I mean: I first added these files in my "Plugins" Folder in the File System Working Directory. They weren´t shown anywhere in Xcode tho (There is also a Plugins Folder in Xcode, which was empty in my case). So I added (you could also say: imported) them as described above to the Xcode Project. – 最白目 Aug 21 '12 at 12:37
  • If you only have it in Xcode, try to copy the files also to the filesystem Folder. – 最白目 Aug 21 '12 at 12:38
  • Tried adding them to xCode, and now the .mm file is giving me a compile error. – aaronhuisinga Sep 03 '12 at 10:01