Application Error when Loading up an Android App
Posted May 13, 2011on:
adb logcat looks like this:
05-13 15:59:31.715 5738 5749 I System.out: onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/index.html
an error dialog also pops up on the device screen.
1. this only happens on working with an actual device. never on emulator.
2. it happens two out of three times of running the app on the device, for example. one out of three runs, let’s say, can be successful (with the app up and running).
reason: timeout value exceeded when loading url
solution: [set the time out value before loading url]
at least now three out of three runs are all successful (with the app up and running).
don’t ask me why an intial 20 seconds are not good enough. and why someone would need a 60 seconds time out value.