Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 4
Registered: ‎07-09-2014
My Device: Blackerry Torch and Q10
Accepted Solution

'undefined' is not a function (evaluating cordova.exec)

Hi,

 

I am this error ['undefined' is not a function (evaluating cordova.exec)] where trying to invoke barcode scanner 

 window.plugins.barcodeScanner.scan(function (result) {

});

 

 

in blackberry q10 (BB10) mobiles but there is no issue on Blackberry smartphones(Blackberry toruch 9830).

 

please help to resolve this issue. 

 

Thanks

Balakrishna.P

 

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: 'undefined' is not a function (evaluating cordova.exec)

Can you provide a link to the plugin you are using? (i.e. Github repo.)

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Developer
Posts: 10
Registered: ‎04-05-2014
My Device: BB Alpha Device

Re: 'undefined' is not a function (evaluating cordova.exec)

Does Cordova support bb10 os?????
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: 'undefined' is not a function (evaluating cordova.exec)

New Developer
Posts: 4
Registered: ‎07-09-2014
My Device: Blackerry Torch and Q10

Re: 'undefined' is not a function (evaluating cordova.exec)

Hi,

 

we are using cordova-2.2.0.js

 

We have developed mobile application "Maintenance Minder" for ios,android,blackberry and windows and it is working fine all mobiles as you can see link in blackberry vendor portal for blackberry smartphones(BBOS) and Blackberry QNX mobiles.

 

But the problem is when clicks on barcode scanner we are getting  'undefined' is not a function (evaluating cordova.exec)

 

not only above issue and also  windows.navigator.notification.vibrate(1000); and windows.navigator.notification.beep(1); is not working(undefined)

 

to check above issue i have installed BlackBerry 10 WebWorks SDK 1.0.4.11

and

BlackBerry10Simulator-BB10_3_0-698

 

please help to reslove.

 

Thanks

Balakrishna.P

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10

Re: 'undefined' is not a function (evaluating cordova.exec)

There appears to be quite a bit of mismatch in versions.

For instance, Cordova didn't officially support BlackBerry 10 until 3.1.0.

Also, Cordova and WebWorks are two separate packaging platforms. And WebWorks SDK 1.0.4.11 is *not* Cordova based. To get Cordova functionality, you must use 2.1.0.13 or higher:
https://developer.blackberry.com/html5/download/

I would highly recommend reading the above documentation on getting started with WebWorks. Without the proper versions of the software, I would expect certain pieces of the code to continue to fail.

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
New Contributor
Posts: 3
Registered: ‎10-15-2014
My Device: Dev Alpha 1

Re: 'undefined' is not a function (evaluating cordova.exec)

Hi Erik,

 

I have this same issue. I have been trying to use the bar code scanner plugin for blackberry at http://plugins.cordova.io/#/package/com.blackberry.community.barcodescanner in my webworks 2.2 app but looks like it is not updated for the latest web works 2.2 (even it's read me suggested that) and it doesn't work off the shelf. Yes, it gives this 'undefined' is not a function when the startRead function is called. Can u pls fix? This app of mine developed in cordova ( for other platforms while for BB, I have used webwprks 2.2) is already published at the other major app stores , of course with a different barcodescanner plugin and I am waiting to publish this at the earliest at BB store

BlackBerry Development Advisor
Posts: 834
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: 'undefined' is not a function (evaluating cordova.exec)

I created a test app using WebWorks 2.2 and the published version of the barcode scanner plugin and it worked for me.

 

Above you mentioned using cordova 2.2 - can you confirm that you are indeed using WebWorks 2.2, which is based on Cordova 3.5.0?

 

Have you tried to use WebInspector on the application? You should be able to connect and trace where the error message is coming from. When you connect to the device IP and port 1337, you are given 3 webviews to choose from. The middle one is your application and may be where the error is, but if it's in the plugin, it's likely to be in the first webview in the list. Try that out and see if you can narrow down the error.

Tim Windsor
Open Source Technical Lead
New Contributor
Posts: 3
Registered: ‎10-15-2014
My Device: Dev Alpha 1

Re: 'undefined' is not a function (evaluating cordova.exec)

Thanks Tim for your response. I didnt mention that I am using cordova 2.2 for BB. Yes, I am using webworks 2.2

 

Yes, I am using Web Inspector too. It is there that I found this error becos of which the app doesn't work. see the error I am getting through web inspector. I used both app. and community. functions as prescribed in different read me pages. I included the cordova.js file added the blackberry.app plugin too. Perhaps, can u send me the project u did so we can proceed based on that?community. Error

 app.Error

 Thanks again for all your help

 

 

 

New Contributor
Posts: 3
Registered: ‎10-15-2014
My Device: Dev Alpha 1

Re: 'undefined' is not a function (evaluating cordova.exec)

Any update on this? Can u please send me the project you tested successfully so we can work with that?