This is likely a connection problem.
If you're facing this on Android emulator, check the network connectivity in the emulator, if it's not working, it should show an exclamation point (!).
If you're facing this on a real device, make sure you're connected on same network as your PC.