The connection to the server was unsuccessful


#1

Hi guys,

Im working with ionic version 2.2.3, the android application show this message in alert when the app starts.

Application Error
The connection to the server was unsuccessful (file:///android_asset/www/index.html)


I tried to change this property in config.xml

<preference name="loadUrlTimeoutValue" value="90000" />

I tried adding this line in MainActivity,java too

super.setIntegerProperty(“loadUrlTimeoutValue”, 90000)

And tried create new html file (main.html) with index.html content, and replacing the content in index.html, with window.relocation to main.html

In any case I got the same results,

Can anyone help me please?


Ionic info
Cordova CLI: 6.4.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4


Android installed platform 6.0.0


#2

Happens for me on older Android devices, but works fine when using a production build. Give that a shot :slight_smile:


#3

I’m having the same issue. We are targeting older devices up to the limit that Ionic supports.

Are their any other solutions?

Thanks


#4

Hello @donCuy,

for me i have create new page (main.html) and change content of my index.html with window.location = ‘./main.html’ but i have error like net://ERR_FILE_NOT_FOUND (file://android_asset/www/main.html)

Can you help me to solve this issue ?

I used ionic 3 version

Regards,


#5

What is the intended purpose of this?


#6

i want to load faster my ionic application.


#7

I can’t see how futzing around with window.location and using alternative index.html files could possibly help with improving load times.