Peter Parker Peter Parker - 1 month ago 31x
Android Question

Ionic emulate android ERR_CONNECTION_REFUSED localhost:8100

I try to emulate my Ionic application on Android. Once my application start in the emulated device, it breaks with the following error:

Application Error

net::ERR_CONNECTION_REFUSED (http://localhost:8100)

and also

Webpage not available

The webpage at http://localhost:8100 could not be loaded because: net::ERR_CONNECTION_REFUSED

Debugging same project works like a charm in browser and in iOS debugger.

cordova-plugin-whitelist is already installed and I have the following rule in my config.xml

<allow-navigation href="http://localhost*"/>

Any help would be appreciated.


I found the solution, I was running the command

ionic run android -c -s -l --address localhost

Removing --address localhost from the command solve my problem means following command is ok

ionic run android -c -s -l

Quite funny, since adding that parameter, let me run my App in the iOS debugger respectively in case of iOS was a must.