net::ERR_CONNECTION_REFUSED when building with android studio

I get that message when building the debug apk with Android Studio. Seems that the app is still trying to build referencing localhost:8100. Steps to reproduce:

  • npm run build
  • npx cap copy android
  • npx cap open android
  • Hit the Build Apk on Android Studio

Here is my capacitor.config.json

  "appId": "io.ionic.starter",
  "appName": "iaire",
  "bundledWebRuntime": false,
  "npmClient": "npm",
  "webDir": "www",
  "cordova": {},
  "server": {
    "url": "http://localhost:8100",
    "cleartext": true,

I also have to say that i have used live-reload feature before.