Praful Kumar
Praful Kumar

Reputation: 181

Ionic app doesn't hit on server when using capacitor

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

Upvotes: 1

Views: 2396

Answers (2)

nick shp
nick shp

Reputation: 90

You trying to reach localhost on emulator but not on remote host. Try to change url to wi-fi network of remote host 192.168.0.* something.

Upvotes: 0

Daniel Feeney
Daniel Feeney

Reputation: 11

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

Upvotes: 1

Related Questions