Using both MeteorCamera and cordova.plugins.barcodeScanner produces "Channel not fired errors: onCordovaReady"

Has anyone used both MeteorCamera and cordova.plugins.barcodeScanner
without getting errors?

The error is:

=> App running at: http://localhost:3000/
I20150915-21:43:07.712(-7) (android:null:1) exception firing pause event from native
I20150915-21:43:16.018(-7) (android:cordova.js:1169) deviceready has not fired after 5 seconds.
I20150915-21:43:16.019(-7) (android:cordova.js:1162) Channel not fired: onPluginsReady
I20150915-21:43:16.022(-7) (android:cordova.js:1162) Channel not fired: onCordovaReady
I20150915-21:43:44.752(-7) (android:http://meteor.local/cordova.js:1169) deviceready has not fired after 5 seconds.
I20150915-21:43:44.753(-7) (android:http://meteor.local/cordova.js:1162) Channel not fired: onPluginsReady
I20150915-21:43:44.754(-7) (android:http://meteor.local/cordova.js:1162) Channel not fired: onCordovaReady

What version of Meteor are you running? 1.2 RC? Have you upgraded the plugins to their latest versions?

Meteor 1.1.0.3

These are the commands I used to add the scanner and camera:

  1. meteor add cordova:com.phonegap.plugins.barcodescanner@2.0.1
  2. meteor add mdg:camera

2.0.1 does not appear to be the latest, but 3.0 did not work.

did you initialize them in Meteor.startup ?

No, they are not initialized in the Meteor.startup function. They are both called from button clicks.

Could you try this with Meteor 1.2 RC (meteor update --release 1.2-rc.15)? Among other things, this comes with a newer Cordova version that knows how to download plugins from npm instead of from the now deprecated Cordova plugin registry.

That should allow you to use the latest version of the phonegap-plugin-barcodescanner plugin (note the plugin ID change), which seems to be 4.0.2.

With the update’s I am getting:

=> App running at: http://localhost:3000/
=> Errors executing Cordova commands:

While running Cordova app for platform Android with options --device:
Error: Command failed: /Users/lorna/meteor/testapp/.meteor/local/cordova-build/platforms/android/cordova/run
–device
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
warning: string ‘menu_settings’ has no default translation.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

/Users/lorna/meteor/testapp/.meteor/local/cordova-build/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: pkg:
/data/local/tmp/android-debug.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)

ExitWithCode:1

That’s an Android error that means the new apk was signed with a different key. You may have to uninstall the app from the device first.

I removed the old app. The new version runs without the channel error message, but the barcode scanner does not work after the scan. The last message I see in the scanner is “found product”, but the data is not returned like it was before. I should see the alert().

Template.scanBarcode.events({
‘click button’: function () {
cordova.plugins.barcodeScanner.scan(
function (result) {
alert(“We got a barcode\n” +
"Result: " + result.text + “\n” +
"Format: " + result.format + “\n” +
"Cancelled: " + result.cancelled);
if (!result.cancelled) {
Session.set(“barcode”, result.text);
}
},
function (error) {
alert("Scanning failed: " + error);
}

 );
}

});

The barcode scanner does not return anything without MeteorCamera.

The barcode scanner does not work (return the barcode) with 1.2RC and 4.0.2 of the plugin. It doesn’t produce an error, just never returns the barcode.

Experiencing the same issue … any suggestions on how to solve this?

No, I never fixed it. They closed my ticket and I do not think they fixed it.

in the click event include e.preventDefault , that did it for me …