We're using OkHttp (through Ktor) and getting on o...
# squarelibraries
l
We're using OkHttp (through Ktor) and getting on one of our servers an UnknownHostException caused by
android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
. However the same URL opens without problems on the same mobile device in Chrome browser. Also it's independent if I'm in the mobile network or WiFi. Also running
adb shell ping
on this URL gets an unknown host.
d
Maybe is a stupid advice but, usually, when I got those kind of error is a DNS problem. Many times due to a VPN or something like that. Dunno if is your case but maybe worth a try. Just my 2 cent.
l
Yes, definitely looks like this. I'm not in VPN though. But I will try to investigate more. Thank you!
👍 1
j
I wonder if the browser is using DoH? You could try it https://github.com/square/okhttp/blob/master/okhttp-dnsoverhttps/README.md
l
I will try it, thank you!
I just checked, and my Chrome browser has the "Secure DNS" option deactivated.
y
This is sometimes background network restrictions.
Android 15 is stricter.
But if other servers are working, then no idea
l
Looks like it's indeed a bug in Android: https://github.com/square/okhttp/issues/6903
y
Good catch. I forgot about that, and had commented on it.