Back

Android APK - "Failed host lookup" Error in Production

  • 0
  • Self Hosted
  • Flutter
  • Android
Fred
3 Oct, 2024, 15:58

Hi everyone,

I'm running into an issue with my self-hosted Appwrite backend and I could use some help. I’ve successfully set up an Android app in my Flutter project, and everything works fine when debugging on a physical Android device connected to my computer (using email/password session to connect to the database).

However, when I build an APK and run the app on my phone without it being connected to Flutter, I get the following error:

ClientException with SocketException: Failed host lookup: 'subdomain.domain.com' (OS Error: No address associated with hostname, errno = 7), uri=https://subdomain.domain.com/v1/account/sessions/email

I’ve already made the necessary adjustments mentioned in the Appwrite package documentation on pub.dev, including adding the activity tag to the Android manifest along with my Project-ID. I initially encountered this issue on a server set up through elest.io, but now I've switched to my own server hosted on Hetzner and am still getting the exact same error.

Since everything works fine in debug mode, I feel like my DNS settings are correct. Does anyone have any ideas on what could be causing this issue in production or what steps I might be missing? Any help would be greatly appreciated!

Thanks in advance!

TL;DR
Issue: "Failed host lookup" error occurs in production for Android APK when connecting to a self-hosted Appwrite backend. Works fine in debug mode. Solution: Check AndroidManifest for internet permission settings. DNS settings are likely correct due to success in debug mode.
Joshi
3 Oct, 2024, 15:59

Set the internet android permission in androidmanifest

Fred
3 Oct, 2024, 15:59

oh, that sounds to easy. thank. i will have a look

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more