1

My Ionic app works fine when running with ionic serve but when i use the command ionic capacitor run android -l it doesn't hit on sever and gives error

Webpage not available: net::ERR_CONNECTION_REFUSED

I am using the latest Ionic version.

capacitor.config.json

{
  "appId": "fire.app.flashlight",
  "appName": "Flashlight",
  "bundledWebRuntime": false,
  "windowsAndroidStudioPath": "C:\\Users\\Digisoft\\Downloads\\Compressed\\android-studio-ide-201.6692364-windows\\android-studio\\bin\\studio64.exe",
  "npmClient": "npm",
  "webDir": "www",
  "plugins": {
    "SplashScreen": {
      "launchShowDuration": 0
    }
  },
  "cordova": {},
  "server": {
    "url": "http://localhost:8100",
    "cleartext": true
  }
}

enter image description here

NearHuscarl
  • 38,825
  • 11
  • 144
  • 140
FIRE
  • 113
  • 12
  • 1
    Make sure your device/emulator has access to the same WiFi network that your server is on. If you have multiple networks available when building, the Ionic CLI will let you choose which one to use. – Sébastien Aug 10 '20 at 10:56
  • Does this answer your question? [Ionic 4 net::ERR\_CONNECTION\_REFUSED(http://localhost/)](https://stackoverflow.com/questions/54525558/ionic-4-neterr-connection-refusedhttp-localhost) – Chetan Bansal Aug 13 '20 at 11:15

1 Answers1

1

Try to erase the "url" inside the "server"