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.
5 Answers
-
Ah, true, restarting the emulator did make the problem go away. Moving on!
-
Doing a google search it seems to be a problem on 1.5 for sure. It's definitely an Android emulator issue.
-
I'm getting that error with Android SDK: "APIs 2.1" too. Not sure why.
-
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.
-
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.