SocketException: Failed host lookup: 'methods.abc.com' (OS Error: No address associated with hostname, errno = 7), StackTrace : SocketException: Failed host lookup: 'methods.abc.com' (OS Error: No address associated with hostname, errno = 7), StackTrace : dart dart

SocketException: Failed host lookup: 'methods.abc.com' (OS Error: No address associated with hostname, errno = 7), StackTrace :


This may not be a Flutter problem. Instead, that is OS Error which is far more low level.

Firstly, have a check at this: Unable to resolve host "<url here>"; No address associated with hostname.

For example, if your user closed his Wifi and mobile network, then you will see this error.

Usually it is not caused by a bug in your code, but just because the user has no network - if he has no network, how can he resolve the domain name!

Thus, for me, personally, I just ignore such type of error. In other words, I do not report these errors to my backend.


Make Sure that you have active internet connection along with permission defined in AndroidManifest.xml


In My case I opened the emulator and after that I connected to the WIFI. So, wifi connected to my system but unable to connect to emulator .

Solutions:

  • I Closed the emulator and re-open it. And Finally works..