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

Just ionic cordova build android --prod --release

It seems it only happens with devices having Android 4.4

Here is another feedback I received today

Same problem without --prod --release?

Could you create a pure Cordova project with cordova create, add the same cordova-android as in your project, and then build/run it via cordova build android?

Hello, yes I confirm, same problem without --prod --release

Thanks for your help but the problem is the new version of cordova-plugin-ionic-webview 2.0 which breaks the compatibility with Android 4.4… I found the solution on another thread:

1 Like

I have a problem net::ERR_CONNECTION_REFUSED

ty bro I solved my problem :heart_eyes::heart_eyes:

For future readers of this topic:
If the device you are testing on is using Android 4.x (e.g. Android 4.4 KitKat), this article might explain what is going on and how to fix it:


This error is fixed in the latest release 2.1.4…

ionic cordova plugin rm cordova-plugin-ionic-webview
ionic cordova platforms remove android
cordova plugin add cordova-plugin-ionic-webview
npm install @ionic-native/ionic-webview

…includes a fix for the webview in KitKat.


thanks for sharing! worked for me, too.

Really @IonicGeoff? only mentions it for an upcoming 2.2.0 release.

Works for me!

It seems to have implemented the changes made here…

Not really, the PR in the changelog is this:

actually i forget to call ionic cordova build android. I get this error ionic cordova platform add android then send to my phone without run build command. Cause there are no files under the www folder. Be sure, you are have got files under the www files.

1 Like

I had the same issue.

In the browser (ionic serve) everything was fine, but the same error with the emulator and real device.

It was a problem with the server dev/smartphone.

I launch the app with livereload and everything works fine.

ionic cordova run android --livereload

1 Like

@MarcoMarco You command is wrong ‘–livereaload’ it must be livereload…

1 Like

@Ionic Team: I also have that issue, none of the solitions above worked. It happens in the emulator and on the real device. It’s really time consuming…Can you provide a solution, that works for all???

hi i am also facing same issue
import { HttpClient } from ‘@angular/common/http’;
this.http.get(url).subscribe((response) => {
i am getting result in browser but not getting response in real device in android
please provide a solution i am using ionic 4 i am getting error like
zone.js:3243 GET http://localhost:8100/sockjs-node/info?t=1559937025579 net::ERR_CONNECTION_REFUSED

I am facing this problem on a device with Android 6, that fix you mentioned you are using Ionic 4, right?
How about the android platform version? What is it?

Mine is 6.3.0 (not sure why).

It’s just a very simple project with Ionic 4, with a map only.

Can you post your “ionic info” output, and also describe the steps to get the error.

Sure Ii can,

Ionic Info:


   Ionic CLI                     : 5.2.2 (/Users/francisco/.npm-packages/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1


   Cordova CLI       : 7.1.0
   Cordova Platforms : android 6.3.0, browser 5.0.4, ios 5.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 5 other plugins)


   cordova-res : 0.5.1 (update available: 0.6.0)
   native-run  : 0.2.7 (update available: 0.2.8)


   Android SDK Tools : 26.1.1 (/Users/francisco/Library/Android/sdk)
   ios-deploy        : 2.0.0
   ios-sim           : 7.0.0
   NodeJS            : v8.11.3 (/usr/local/bin/node)
   npm               : 6.10.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001
> cordova plugin ls
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-googlemaps 2.6.2 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

Running on an Android device (just the same way I always did) in debug mode:
% ionic cordova run android -l -c --device --verbose --no-native-run

In my case it shows:
net::ERR_CONNECTION_REFUSED (http://localhost:8100/)

This is a very simple project in Ionic4, but I also have another one in Ionic3 that’s happening the same problem.

The device is a Samsung S5 with Android 6.0 (SM-G900M)

BTW, thanks for replying!