Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android, periodic XHR failure, Host is unresolved

Every so often XHR will fail with the below error. The only way to fix this is to restart the emulator. This is for sure happening on Android - i'm not sure on iPhone.

[TRACE] I/InetAddress( 1151): Unknown host apitest.lafitness.com, throwing UnknownHostException
[TRACE] E/TiHttpClient( 1151): (TiHttpClient-1) [3494,49086] HTTP Error: Host is unresolved: apitest.lafitness.com:80
[TRACE] E/TiHttpClient( 1151): java.net.UnknownHostException: Host is unresolved: apitest.lafitness.com:80

Now of course it is possible to resolve apitest.lafitness.com so i'm not totally sure on what is going on here and why it goes away on restart of the emulator.

— asked May 21st 2010 by Vinh Bui
  • android
  • error
  • host
  • xhr

5 Answers

  • Ah, true, restarting the emulator did make the problem go away. Moving on!

    — answered June 15th 2010 by Andrew Blair
    1 Comment
    • Android simulator is the bigger shi* ever…

      — commented March 14th 2012 by Bernat Bombi
  • Doing a google search it seems to be a problem on 1.5 for sure. It's definitely an Android emulator issue.

    — answered May 21st 2010 by Don Thorp
  • I'm getting that error with Android SDK: "APIs 2.1" too. Not sure why.

    — answered June 15th 2010 by Andrew Blair
  • I seem to get no internet with webviews as well after a few days of having the emulator running, sometimes a few hours, but mostly the emulator can be running for days.

    I just routinely reboot it.

    — answered June 15th 2010 by Ryan Tregea
  • Restarting the emulator is a great first step. If that doesn't work (doesnt always for me), then go to the Android SDK and AVD Manager… then delete the virtual devices. The emulator will auto create them when it is fired up next.

    — answered June 21st 2011 by John Brennan
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.