1

I've have a problem when I use the --livereload in following command: ionic run android --livereload. If I does not use --livereload the app works fine. This also only occurs when I test on a physical device. On an emulator there are no issues.

I've already tried several options like:

<preference name="loadUrlTimeoutValue" value="700000" />

Or the index to main.html solution like explaned here: How to fix the connection to the server was unsuccessful. (file ///android_asset/www/index.html)

Does anyone know what is the cause of the problem and how to solve it?

Robin Bruneel
  • 1,063
  • 8
  • 22

2 Answers2

0

Well it seems like your physical device is not able to communicate with machine. Reason could be

  1. Port not accessible because of any firewall restriction
  2. Both under different networks, therefore machine's IP is not accessible from device.

When you run "Ionic cordova run android --l", you get an IP address in command line, did you try accessing that IP along with port from device's browser?

Aman
  • 1,292
  • 1
  • 14
  • 20
0

After a time I've noticed that when I've closed my terminal window in Intelij the problem never occured. Now I end the process and then close the terminal.

It seems that somehow the process remained active after "stopping" it. I'm running my ionic run android --livereload --target=emulator-5554 command in a new terminal now.

enter image description here

Robin Bruneel
  • 1,063
  • 8
  • 22