Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.net.UnknownHostException(Unable to resolve host "play.googleapis.com": No address associated with hostname)

Full error message is shown below. This occurs while running an app in an emulator that uses Urban Airship and Google Cloud Messaging. I do not see it on device.

java.net.UnknownHostException(Unable to resolve host "play.googleapis.com": No address associated with hostname)

BTW, UA Guys How Do you shut off UA? commenting out UA.takeoff() leads to null point exceptions! Way to go! Thats a way to end up on stackoverflow!

like image 650
TestBest Avatar asked Dec 15 '22 06:12

TestBest


1 Answers

Most common reason for UnknownHostException is missing Internet-Permission. Check your AndroidManifest.xml for
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

Update:
later comment says, internet connectivity is allowed and it works on device. So it's emulator issue. Possible solutions:

  • use IP instead of hostname (for a test)
  • re-create the AVD
  • check min-SDK seetings against AVD sdk version
like image 136
think-Android Avatar answered May 12 '23 06:05

think-Android