2
votes

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??

1
i think u should update the calling mechanism from ur js to the plugin.Subrat nayak.
What do you mean by calling mechanism??Arindam Mukherjee
I added the key value pairs in the corodova.plist file..key as org.apache.cordova.barcodeScanner and value as CDVBarcodeScannerArindam Mukherjee
cordova.exec call in js,Subrat nayak.
try these things: stackoverflow.com/questions/10450259/…. I have the same problem. It didn't help me but it might help you.最白目

1 Answers

3
votes

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.