getting net::ERR_CONNECTION_REFUSED (http://localhost:8080) on android 4.4.2 version

I faced the same problem in Android 4.4, Android 6.0 but not in Android 8.0. I just added this code in config.xml to allow the localhost.

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

For more information please follow this link: WKWebView


Your problem is caused by the cordova-plugin-ionic-webview plugin that is part of every new or updated Ionic app.

This used to apply only to iOS, where it replaced the UIWebView with WKWebView, but on July 23rd 2018 they released version 2.0 of the plugin, that also included changes to the webview used on Android.

The Android webview now uses a local webserver at localhost:8080 to show your app instead of requesting the files directly from the file system.

Unfortunately this change also included this bit in the documentation:

Requirements
- […]
- Android: Android 5.0+ and cordova-android 6.4+

So cordova-plugin-ionic-webview just doesn’t support Android earlier than 5.0 any more, which of course means your app will not work on Android 4.x.

One solution is to downgrade the plugin to the last version that supported Android 4.x:

ionic cordova plugin add [email protected]

More elaborate information and alternative solutions:
https://ionic.zone/debug/ionic-and-android-4