Home:ALL Converter>Ionic 4 net::ERR_CONNECTION_REFUSED(http://localhost/)

Ionic 4 net::ERR_CONNECTION_REFUSED(http://localhost/)

Ask Time:2019-02-05T06:57:57         Author:Redouan Ait El-mkdem

Json Formatter

I'm facing a problem that when I try to create mobile Front-End application based on Ionic 4 but a net:ERR_CONNECTION_REFUSED(http://localhost/) show up when I run it with cordova on android studio emulator. This what i m using

Angular CLI: 7.1.4
Node: 8.9.4
OS: win32 x64
Ionic version   4.5.0

My config.xml

config.xml

Author:Redouan Ait El-mkdem,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54525558/ionic-4-neterr-connection-refusedhttp-localhost
Hectorromerodev :

\nYou can try to use this\n\nionic capacitor run <platform> [options]\n\nionic capacitor run android -l --external\n\n\n--external can help to use the app on external devices on the same\nnetwork. just try it...\n\nionic capacitor run\nionic capacitor run android\nionic capacitor run android -l\nionic capacitor run ios --livereload\nionic capacitor run ios --livereload-url=http://localhost:8100\n\n\nI found this on capacitor docs ionic capacitor run\n",
2020-07-11T04:39:01
Aaron Jordan :

For anyone else losing their mind that might be using Capacitor go into your capacitor.config.json file and remove this:\n\n\"server\": {\n \"url\": \"http://localhost:8100\"\n}\n\n\nI've had this in my config file for sometime and only just now started causing issues so I'm not sure if a new Capacitor patch has changed this behavior on prod builds or what but this resolved my issue. God speed to the rest of you.",
2019-11-05T06:53:18
Sampath :

20-09-2020: For Capacitor apps\nThis didn't work for me: I don't know why.\nionic cap run android -l --external\n\nBut this works:\nionic cap run android -l --host=0.0.0.0\n",
2020-09-20T15:52:46
yy