UnknownHostException indicates there is a local DNS resolver error. The device isn't able to resolve DNS names.
It most often occurs when the Android device's Internet connection is unstable - no cellular signal, no Wi-Fi network connectivity, low signal strength, or the device is connecting through a Wi-Fi network that isn't connected to the global Internet due to a local outage.
Ensuring the device has a healthy connection resolves the issue. If the issue persists, ensuring the DNS servers the device is connecting to are reachable and healthy is the next step in investigating the root cause of the issue.