Cordova.Plugins.barcodeScanner undefined

6 posts, 0 answers
  1. Ken
    Ken avatar
    5 posts
    Member since:
    Sep 2015

    Posted 20 Jan Link to this post

    I have a mobile app that I have written that utilizes the barcodescanner plugin. It used to work just fine until about a week ago. Now when I run the app in the AppBuilder extension for Visual Studio 2015 I get the following error whenever the barcodescanner is initialized.

    "Uncaught TypeError: Cannot read property 'barcodeScanner' of undefined at scripts/esig.js (line: 101)"

     Below is the code used to initialize the scanner:

     scanBarcode: function () {
                cordova.plugins.barcodeScanner.scan(
                function (result) {
                   if (!result.cancelled) {
                       app.esigService.viewModel.searchAccountNumber = result.text;
                       app.esigService.viewModel.getPatientByAccountNumber();
                   }
                }, ...

     When the app is loaded and then logged into the following code fires:

     onLoad: function () {
                if (app.isAuthenticated) {
                    if (app.esigService.viewModel.firstLoad) {
                        app.esigService.viewModel.scanBarcode();
                        app.esigService.viewModel.firstLoad = false;
                        app.esigService.viewModel.getFormGroups();
                    }
                }
                else {
                    global.app.application.navigate("#home");
                }
            },

    The plugin is enabled in the properties of the app. I cannot figure out why I am getting this error. Any help is greatly appreciated.

     

    Thank you,

     

    Ken S.

     

  2. Ken
    Ken avatar
    5 posts
    Member since:
    Sep 2015

    Posted 20 Jan in reply to Ken Link to this post

    Also here is the Log Output from the AppBuilder. Maybe this will help.

    [2016-01-20 07:48:02.115] Log (Exception,High): System.ArgumentException: Plugin with given ID was not found in marketplace.
       at OperationExecutorExtensions.<RequestAsyncCore>d__11`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at OperationExecutorExtensions.<RequestAndParseAsync>d__1f`2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Telerik.BlackDragon.Client.Modules.Cordova.ViewModels.PluginViewModelProvider.<SetMarketplacePluginVariables>d__16.MoveNext()

  3. Aleksandar Hitrov
    Admin
    Aleksandar Hitrov avatar
    10 posts

    Posted 22 Jan Link to this post

    Hello Ken,

    I suspect that the issue you are reporting is due to us removing a version of the BarcodeScanner plugin from our Marketplace plugins repository.

    Updating the BarcodeScanner plugin version to the latest (the latest version is currently 2.0.0) should fix this. You can change by following theses steps:
    1.) Right-click on the project in the Solution explorer
    2.) Select Manage Packages
    3.) In the Manage Packages dialog select the Plugin Marketplace tab
    4.) Select the BarcodeScanner plugin from the plugins list
    5.) On the right-hand side of the dialog you should now see the details for the BarcodeScanner plugin
    6.) From the version drop-down select 2.0.0 and press the Change button
    7.) Re-build and re-deploy your application

    If changing the version of the BarcodeScanner plugin is not an option for you or your problem persist even after you've updated the plugin's version to the latest we will need the entire sources of your app in order to investigate further.

    Please accept my apology for this inconvenience and let me know if the above steps don't work or you have more questions.

    Regards,
    Aleksandar Hitrov
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  4. Ken
    Ken avatar
    5 posts
    Member since:
    Sep 2015

    Posted 22 Jan in reply to Aleksandar Hitrov Link to this post

    Aleksandar,

     

    Thank you for your response. However, I have tried updating the plugin from the Plugin Marketplace through the solution that you suggested. I have also uninstalled the app completely and installed it manually by downloading the plugin. Neither option makes any difference at all. Either way I still get the "Uncaught TypeError: Cannot read property 'barcodeScanner' of undefined at scripts/esig.js (line: 101)" as explained above. How do I proceed to the next step of assistance from your team? I need this resolved today if at all possible. Thank you.

     

    Ken S.

  5. Ken
    Ken avatar
    5 posts
    Member since:
    Sep 2015

    Posted 25 Jan Link to this post

    Hello,

     I am still having the same issue. Does anyone have a solution to this issue? 

     Thank you,

     Ken S.

  6. Aleksandar Hitrov
    Admin
    Aleksandar Hitrov avatar
    10 posts

    Posted 27 Jan Link to this post

    Hi Ken,

    Thank you for submitting your issue through our ticketing system. This is this is best way to receive a timely response to any urgent issues. In addition, the Platform Professional subscription you have also entitles you to guaranteed 48 hours response time.

    Note that we can’t guarantee a response time in our forums and although we do our best to address all questions, replies might be delayed. This is why I would recommend that you submit a support ticket for any technical issues you need prompt response to. 

    Regards,
    Aleksandar Hitrov
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top