Cordova Connection to server was Unsuccessful

user3151224 picture user3151224 · May 7, 2014 · Viewed 17k times · Source

The Connection to the server was unsuccessful(file:///android-asset/www/index.html)

is showing when i run my android application. please let me know how to resolve this issue.

Answer

Dunc picture Dunc · Apr 8, 2016

For latest Cordova (4+) this a setting in config.xml:

e.g.

<preference name="LoadUrlTimeoutValue" value="70000"/>

Increases default timeout to 70 seconds (default is 20), reducing the chance of timing out.

Docs: https://cordova.apache.org/docs/en/latest/config_ref/index.html#preference

When loading a page, the amount of time to wait before throwing a timeout error.