GithubHelp home page GithubHelp logo

Comments (17)

Eccenux avatar Eccenux commented on May 29, 2024

This seems to be a plugman issue(s):

  1. In current version the plugin dir need to be named "com.phonegap.plugins.barcodescanner".
  2. You need to manually add an empty plugins tag in "platforms\android\res\xml\config.xml" (just add <plugins></plugins> above </widget>).

There are also multiple "config.xml" files and the one in "www" folder is not copied to "platforms\android\res\xml". Which is another issue...

from barcodescanner.

lborie avatar lborie commented on May 29, 2024

I confirm this issue too...

from barcodescanner.

jonathannaguin avatar jonathannaguin commented on May 29, 2024

I have this issue using Cordova-cli:

$ cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
[Error: grafting xml at selector "plugins" from "Project/platforms/android/res/xml/config.xml" during config install went bad :(]

from barcodescanner.

Eccenux avatar Eccenux commented on May 29, 2024

@jonathannaguin For now you should use cordova 2.9. There seem to be a bit of a chaos in the documentation at the moment.

from barcodescanner.

jonathannaguin avatar jonathannaguin commented on May 29, 2024

I think that this response cover this issue...

from barcodescanner.

dschien avatar dschien commented on May 29, 2024

@jonathannaguin with your comments in the issue Issue #32 linked-to above I could successfully compile a project with the cordova lib 3.0.0 using the phonegap npm tool instead of cordova.
Yet, the BarcodeDemo from https://github.com/wildabeast/BarcodeDemo still won't work out of the box. There is simply no reaction when trying to scan anything.
With your suggested changes to plugin.xml including the barcodescanner.js is copied to the apk file but I didn't understand any of what the documentation said about clobbing and merging. And I have no idea how to check that there is actually something available at plugins.barcodeScanner.scan.

Any help is greatly appreciated.

from barcodescanner.

dschien avatar dschien commented on May 29, 2024

@Eccenux - you suggest to use cordova 2.9 - that indeed helped.

It took me forever because a few people have forked the orginal repo from wildabeast - which is outdated but still linked to by the plugin docu.

However, using your fork with cordova 2.9.4 and including jonathannaguin comment #32 (comment)
I can compile and scan.

I did not manage with cordova 3.0.0.

I am only starting with phonegap development but this was a really disheartening experience...

from barcodescanner.

Eccenux avatar Eccenux commented on May 29, 2024

@dschien There are some major changes in Cordova at the moment. You can use PhoneGap Build if you want to avoid some problems.

At the bottom of this page you will find instructions that worked for me today on Cordova 3.0: https://github.com/Eccenux/BarcodeScanner/tree/master/src/android/
Note that at the moment you need to clone my repo in step two (original is not updated yet).

For a test app you can use (it's Polish, but with mostly English comments): https://github.com/Eccenux/PP-tracker/tree/master/app
Note that you will have to change app name in config.xml (remove space) and in index.html change phonegap.js to cordova.js.

from barcodescanner.

jonathannaguin avatar jonathannaguin commented on May 29, 2024

@dschien I forgot to mention some changes I made to barcodescanner.js. I updated the other issue with this. Basically clobbers indicates that the module.exports is inserted into the window object under the target specified. It is because of this why the plugin is under plugins.barcodeScanner.

from barcodescanner.

aruballo avatar aruballo commented on May 29, 2024

@Eccenux Your comment helped me get it working for android using Cordova/Phonegap 3.0 (This jump to the newest version is a mess; don't even get me started on the documentation.) However the grafting issue I am still seeing with iOS. I tried to follow the same instructions you had for android with the exception of the platform parameters that the plugman command uses but it didn't work. You wouldn't by any chance know how to get it working on iOS? Or perhaps I did something wrong.

Thanks for your help!

from barcodescanner.

Eccenux avatar Eccenux commented on May 29, 2024

@aruballo Unfortunately I cannot compile on Mac so cannot really check how it works, but Jonathan made some changes in iOS code for 3.0. Others reported that this version of CDVBarcodeScanner works fine on 3.0:
https://github.com/jonathannaguin/BarcodeScanner/blob/master/src/ios/CDVBarcodeScanner.mm

BTW. Docs seem to be fixed now in "edge" version, at least for Android.

from barcodescanner.

aruballo avatar aruballo commented on May 29, 2024

@Eccenux Thanks! I got the plugin installed now. However I am having another issue now..

@jonathannaguin Hello Jonathan. I followed your instructions here:
http://stackoverflow.com/questions/18142247/phonegap-3-0-0-barcodescanner-plugin

However, now I am having the following issue when I call the scan:
2013-08-09 17:58:57.416 PUIClient[3160:907] CDVPlugin class CDVBarcodeScanner (pluginName: BarcodeScanner) does not exist.
2013-08-09 17:58:57.419 PUIClient[3160:907] ERROR: Plugin 'BarcodeScanner' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

However I can see that the plugin is defined in the config xml and in the cordova_plugins.js. On top of all that the relevant files do exist in the classes folder.

I am calling the scan like this:

plugins.barcodeScanner.scan(
...
relevant code here

..
);

Im not completely experienced with the mac programming environment. In the android project I had to create a script tag to call the barcodescanner.js file but for the mac I dont currently have that tag, although it has not made a difference whether I called it or not.

Anyways I am getting carried away. If you can help, or see what I am doing wrong let me know and that'd be great. Thanks guys!

from barcodescanner.

jonasneustupny avatar jonasneustupny commented on May 29, 2024

Thanks for all the work!

Will there be an installation routine like "cordova plugin add http://xyz..." to install the plugin correctly?
That would be a huge help for people like me who don´t really see through all the repositories with barcodeScanner plugin in different versions ..

jonas

from barcodescanner.

aruballo avatar aruballo commented on May 29, 2024

I rebuilt the application three times and for some reason now the camera comes up for the scan. I think my problem was related with a warning my project was giving me:
"Validate project Settings
Update to Recommended Settings"

Before, I was clicking this warning and letting it resolve the problem but now I am ignoring it and the camera is now coming up when I call scan.

Scanning itself isn't working however..it just doesn't detect any barcodes, which are the same barcodes my Android version is detecting with the same plugin.

If I find anything I'll let you guys know.

from barcodescanner.

emaV avatar emaV commented on May 29, 2024

This saved my day (on Mac OSX 10.8.4, phonegap 3.0.0-0.14.3)
phonegap local plugin add https://github.com/jonathannaguin/BarcodeScanner.git

from barcodescanner.

andue avatar andue commented on May 29, 2024

same here, thanks @emaV

from barcodescanner.

wildabeast avatar wildabeast commented on May 29, 2024

Should be fixed now with the latest merged contributions.

from barcodescanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.