org.apache.cordova.device causing Channel not fired: onCordovaInfoReady

3,384 views
Skip to first unread message

Nathan Jones

unread,
Jan 10, 2014, 3:48:41 PM1/10/14
to phon...@googlegroups.com
Hello,
We are exploring the Cordova possibilities, but I have run into a problem using 3.3

If I do a fresh install of node.js and cordova and then run these commands:

$ cordova create test
$ cd test
$ cordova platform add ios
$ cordova build; cordova serve

Then at http://localhost:8000/ios/www I get the little robot guy saying device connected. If I then do this:

$ cordova plugin add org.apache.cordova.device
$ cordova build; cordova serve

Then I get the “device connecting” message and nothing else. If I look in the browser console, then I see:

"deviceready has not fired after 5 seconds."
"Channel not fired: onCordovaInfoReady”

If I remove the device plugin, then it goes back to working as expected. Other plugins (contacts, camera, geo) all seem to work fine.

I get the same behavior on Safari, Chrome and FF on Mac and on IE on Windows. I've gotten mixed behaviors on the iOS simulator and device. They usually don't behave as expected, but sometimes do.

Is there something that I am doing wrong?

Shazron

unread,
Jan 13, 2014, 8:51:22 PM1/13/14
to phonegap
No, this is expected for the device plugin. Not sure if this will be fixed since it wasn't designed to be run in the browser.


--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nathan Jones

unread,
Jan 14, 2014, 8:22:06 AM1/14/14
to phon...@googlegroups.com
I can understand that the library would not deliver results in the browser, but it kills the whole app, even if I don't make any calls to it. This means that if I use the device library at all, then I cannot use the browser to test? This seems extreme to me. Especially since there doesn't seem to be a way to conditionally include the library.

Has anyone got any sort of workaround? I want to be able to look at the device info if it is there, but to safely ignore it if the platform doesn't support it.

thanks.

Alex Lopez

unread,
Apr 6, 2014, 11:44:05 PM4/6/14
to phon...@googlegroups.com
Perhaps go to your index.js file whenre the device plugin is called and do this:
if (typeof device !== "undefined" && device !== null) {
  // do something here for device
Reply all
Reply to author
Forward
0 new messages