Connection to server was unsuccessfull

My app has following error

Application error, connection to server was unsuccessfull(file:///android_asset/www/index.html)

this error is reported by users. Unfortunatly we are not able to reproduce this error even with slow n/w connections.

n/w does not matter here as it’s a file URL

it is happening randomly. can you explain me the root cause for this.

Maybe your index.html is loading external assets like css, fonts or images.
Your index.html may load fast as it is local (file://) but could be blocked by waiting foran external server to respond for remote assets.

Don’t use remote assets, embed them in your apk.

I got this error reported by a user too. I also couldnt reproduce it. Index html does not load anything from external server.

The same problem happened to all my android users last night for no reason at all.

The same build that has been working for weeks sudddenly got this error on every android device.
This morning, everything fell into place again.

However, I do not want this to ever happen again, did you come up with a solution?

There is no external link at all on my code.

The same problem here. I’m using latest version of ionic2 (and everything else updated to latest versions). To exclude any potential problem with my code I created dummy ‘hello world’ app. Nothing more then this:

$ ionic start --v2 IonicHello blank
$ cd IonicHello
$ ionic platform add android
$ ionic run android

I’m deploying such app into two devices:

  • Samsung Galaxy S5 with Android 6.0.1
  • Samsung Advance GT-I9040 with Android 4.1.2

Deployed app works well on Samsung Galaxy S5 but on Samsung Advance I’m getting error after some time of waiting: “Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html)”.


Problem occurs every time on Samsung Advance (and never happens on S5).

Samsung Advance has latest OS updates and was reset to factory defaults before this test. Other info about my env:

$ ionic info

Your system information:

 ordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.4
Xcode version: Not installed
$ ionic platforms

Installed platforms:
  android 6.1.2
Available platforms:
  amazon-fireos ~3.6.3 (deprecated)
  blackberry10 ~3.8.0
  browser ~4.1.0
  firefoxos ~3.6.3
  webos ~3.7.0
  windows ~4.4.0
  wp8 ~3.8.2 (deprecated)
$ npm --version -g ionic
3.10.10

Anybody could help?

Add this to your config.xml.
This sloved my issue:
<preference name="loadUrlTimeoutValue" value="700000" />

1 Like