Search code examples
iosflutterappwrite

Failed lookup 'hostname' ios simulator


I'm building a Flutter app that uses Appwrite as a backend server, but I'm running into a 'Failed host lookup' error when trying to authenticate a user. The Appwrite server is running fine on Docker, and I've checked that my network settings are properly configured. However, I'm still having trouble connecting to the server. I'm using the correct endpoint URL and authentication credentials, but I'm not sure what else to check. Any suggestions for troubleshooting this issue or additional steps I can take to resolve the connection error?

Here's the link to the tutorial: Transform Your App-Building Skills: Build a Twitter Clone App with Flutter, Appwrite and Riverpod!

I've tried changing the endpoint url from "http://localhost:80/v1" to "http://MY_IP_ADDRESS:80/v1" and it still hasn't worked. I know it is something to do with the server because even if I try to run it on chrome web it says something like XMLHTTP request failed.


Solution

  • If you're getting this exact error:

    Failed lookup 'hostname'

    you might not actually be calling client.setEndpoint() with your endpoint because the default endpoint is https://HOSTNAME/v1.