Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap cordova 2.7.0 error when pausing app

I've created a clean cordova 2.7.0 project by using the phonegap tool "create" (create project_folder package_name project_name) and I've deployed the app to my Nexus 4 (androind 4.2.2). No code has been written.

The app has been executed with no errors because it has shown the phonegap logo and "apache cordova device is ready". The problem is that when I tap the standard android right button(which shows recent running apps) I see in the eclipse LogCat that an error ocurrs:

05-07 18:29:54.957: D/webviewglue(24649): nativeDestroy view: 0x731f4738
05-07 18:30:10.163: D/DroidGap(24649): Paused the application!
05-07 18:30:10.163: D/CordovaWebView(24649): Handle the pause
05-07 18:30:10.453: W/IInputConnectionWrapper(24649): showStatusIcon on inactive InputConnection
05-07 18:30:10.743: D/DroidGap(24649): onDestroy()
05-07 18:30:10.743: D/CordovaWebView(24649): >>> loadUrl(javascript:try{cordova.require('cordova/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};)
05-07 18:30:10.743: D/PluginManager(24649): init()
05-07 18:30:10.753: D/CordovaWebView(24649): >>> loadUrlNow()
05-07 18:30:30.765: E/CordovaWebView(24649): CordovaWebView: TIMEOUT ERROR!
05-07 18:30:30.765: D/Cordova(24649): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=javascript:try{cordova.require('cordova/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};
05-07 18:30:30.765: D/DroidGap(24649): onMessage(onReceivedError,{"errorCode":-6,"url":"javascript:try{cordova.require('cordova\/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};","description":"The connection to the server was unsuccessful."})

After this error I tap the app from the list and a popup titled "Application Error" appears containing exactly this message:

"The connection to the server was unsuccessful. (javascript:try{cordova.require('cordova/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};)"

This behavior happens always (sometimes it requires to pause the app by using the recent apps list button twice).

Any ideas?

Thank you in advance.

UPDATE: As suggested by Romain Braun by using 2.4.0 the error does not occur.

like image 611
Endymion Avatar asked May 07 '13 16:05

Endymion


1 Answers

This bug appeared after the release of Cordova 2.5

Yet no one has found a solution.

I'd recommend reporting the bug to the phonegap team, and downgrading your Cordova version to 2.4 if it is possible.

like image 107
Romain Braun Avatar answered Oct 01 '22 00:10

Romain Braun