I made a simple weather widget that calls the API with RetroFit. It works well on emulators and my Samsung S22 Ultra, except for my S24 Ultra which keeps getting the error.
Both phones have pretty much the same settings with the same Android version (14).
Not sure if mobile data has anything to do with it but it was working fine until I disconnected the WiFi and was using data. However, reconnecting to Wifi doesn't work, it just cant resolve the API's hostname.
I have tried:
Nothing worked
Turns out the problem is that my phone was on power saving mode. Either turn it off or change the app's battery option to "Unrestricted".