Forum

We noticed a direct update problem while testing our Android app. We are trying to simulate a network disconnection during the update, and trying to recover the update after restoring the connection. We have been able to reproduce this on 5.0.5 and 5.0.5.1 using both emulators (4.1.2) and device (4.2).<br />
<br />
I was wondering if anyone else has come across this type of connection issue and direct update? Thanks.<br />
<br />
Steps to reproduce<br />
1. Update any JS, CSS, HTML file in the Worklight project, and then build and deploy the app.<br />
2. Launch the app. The 'Update is Available' prompt appears.<br />
3. Go to device/emulator settings and disconnect the network connection on the device (turn on Airplane Mode on the emulator).<br />
4. Return to app. click "Update". Confirm the update failed (the 'Update Failed' prompt appears).<br />
5. Go to device/emulator settings, re-enable the network on the device (disable Airplane Mode)<br />
6. Return to app, click "Reload" and/or "Exit"<br />
<br />
Observations<br />
1. Clicking Exit -&gt; successfully closes the app. Launching the app again will prompt the user to download the update and if selected the update is successful.<br />
2. Clicking Reload -&gt; the app attempts to download the update, fails with the below exception, and the Update Failed message is displayed again.<br />
<br />

<pre class="jive-pre">
<code class="jive-code jive-java">
01-21 11:11:50.661: D/WLDroidGap(1660): setCookies() can<span style="color: navy">
't parse cookie null.</span> 01-21 11:11:51.082: W/DefaultRequestDirector(1660): Authentication error: Unable to respond to any of these challenges: <span style="color: navy">
{</span>wl-composite-challenge=WWW-Authenticate: WL-Composite-Challenge<span style="color: navy">
}</span> 01-21 11:11:51.082: D/WLDroidGap(1660): Faild to downloading update zip file - content type is application/json; charset=UTF-8, <span style="color: navy">
<b>
while</b></span> it should be application/zip 01-21 11:11:51.091: D/WLDroidGap(1660): Finish copy files to local storage from updated zip file... 01-21 11:11:51.091: E/WLDroidGap(1660): Failed downloading application update file. 01-21 11:11:51.171: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread <span style="color: navy">
'AsyncTask #1'</span>. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.171: W/webview_proxy(1660): at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.171: W/webview_proxy(1660): at android.webkit.WebView.canGoBack(WebView.java:894) 01-21 11:11:51.171: W/webview_proxy(1660): at org.apache.cordova.CordovaWebView.canGoBack(CordovaWebView.java:620) 01-21 11:11:51.171: W/webview_proxy(1660): at org.apache.cordova.DroidGap.loadSpinner(DroidGap.java:381) 01-21 11:11:51.171: W/webview_proxy(1660): at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:369) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:315) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.171: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.171: W/webview_proxy(1660): at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.171: W/webview_proxy(1660): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.171: W/webview_proxy(1660): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.171: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.171: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.171: W/webview_proxy(1660): at java.lang.Thread.run(Thread.java:856) 01-21 11:11:51.471: D/dalvikvm(1660): GC_CONCURRENT freed 403K, 7% free 8804K/9415K, paused 21ms+189ms, total 375ms 01-21 11:11:51.551: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread <span style="color: navy">
'AsyncTask #1'</span>. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.551: W/webview_proxy(1660): at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.551: W/webview_proxy(1660): at android.webkit.WebView.loadUrl(WebView.java:767) 01-21 11:11:51.551: W/webview_proxy(1660): at org.apache.cordova.CordovaWebView.loadUrlNow(CordovaWebView.java:504) 01-21 11:11:51.551: W/webview_proxy(1660): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:388) 01-21 11:11:51.551: W/webview_proxy(1660): at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:371) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:315) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.551: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.551: W/webview_proxy(1660): at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.551: W/webview_proxy(1660): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.551: W/webview_proxy(1660): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.551: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.551: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.551: W/webview_proxy(1660): at java.lang.Thread.run(Thread.java:856) 01-21 11:11:51.981: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread <span style="color: navy">
'AsyncTask #1'</span>. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.981: W/webview_proxy(1660): at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.981: W/webview_proxy(1660): at android.webkit.WebView.addJavascriptInterface(WebView.java:1487) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.bindBrowser(WLDroidGap.java:215) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:316) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.981: W/webview_proxy(1660): at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.981: W/webview_proxy(1660): at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.981: W/webview_proxy(1660): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.981: W/webview_proxy(1660): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.981: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.981: W/webview_proxy(1660): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.981: W/webview_proxy(1660): at java.lang.Thread.run(Thread.java:856)</code>
</pre>
There are no topics to display.