Retrofit cannot connect to my local web server on port 3000

前端 未结 2 961
广开言路
广开言路 2020-12-15 17:30

My app that is using Retrofit (v1.6.1) to connect to REST web services cannot connect to my local web server (running on localhost), this is the error I am gett

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 17:45

    I solved the issue, need to use 10.0.2.2 instead of localhost to connect to my local server.

    Found it here - http://developer.android.com/tools/devices/emulator.html#networkaddresses

提交回复
热议问题