Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
-
windows 8.1 and OSx
Cordova 4.3.0
Description
When the Device plugin is added to a cordova project and the software is tested using the "cordova serve" option (run a local web server for testing with a browser) the software locks up and fails to start.
There is an exception in the Device plugin as below
Exception calling native with command :: Device :: getDeviceInfo ::exception=ReferenceError: 'Windows' is undefined
This is not supprising as there is no device, it's just serving the app through a web server.
However the software locks up because the "onCordovaInfoReady" is never fired.
A simple fix is to modify the device.js file as below
channel.onCordovaReady.subscribe(function() {
var callFailed = true; // NEW assume the getInfo fails
me.getInfo(function(info)
,function(e)
{ // NEW failure will be handled below utils.alert("[ERROR] Error initializing Cordova: " + e); });
// new code to stop the system locking up
if(callFailed)
With this mod inplace the software will work, obviously the device information is invalid.