Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D97471861F for ; Tue, 28 Apr 2015 09:34:06 +0000 (UTC) Received: (qmail 47541 invoked by uid 500); 28 Apr 2015 09:34:06 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 47514 invoked by uid 500); 28 Apr 2015 09:34:06 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 47495 invoked by uid 99); 28 Apr 2015 09:34:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Apr 2015 09:34:06 +0000 Date: Tue, 28 Apr 2015 09:34:06 +0000 (UTC) From: "John Little (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-8830) application locks up when run with "cordova serve" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-8830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14516726#comment-14516726 ] John Little commented on CB-8830: --------------------------------- I was not aware there was a "browser" platform, I used the windows one as it is doesn't require any binarys to work. The all the windows 8.1 interfaces are in javascript and sort of work, if they were written with try/catches arround some of the platform specific objects they would just work. > application locks up when run with "cordova serve" > -------------------------------------------------- > > Key: CB-8830 > URL: https://issues.apache.org/jira/browse/CB-8830 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Device > Environment: windows 8.1 and OSx > Cordova 4.3.0 > Reporter: John Little > > 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) { > callFailed = false; // NEW it's all good > //ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js > //TODO: CB-5105 native implementations should not return info.cordova > var buildLabel = cordova.version; > me.available = true; > me.platform = info.platform; > me.version = info.version; > me.uuid = info.uuid; > me.cordova = buildLabel; > me.model = info.model; > me.manufacturer = info.manufacturer || 'unknown'; > channel.onCordovaInfoReady.fire(); > },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) { > me.available = false; // NEW can't be available as getInfo failed > channel.onCordovaInfoReady.fire(); // NEW fire event to allow system to work > } > With this mod inplace the software will work, obviously the device information is invalid. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org