I just spent a few hours debugging something, and I thought it might be worth posting in case anyone else out there might ever have this obscure problem.
My app brings up an external page in a WebView that contains ads. My emulator and my phone (not rooted) brought up these pages with little problems, but on my rooted Transformer Tablet, in my assigned WebViewClient, I kept getting an onReceivedError method call, errorCode=-6, description=”The connection to the server was unsuccessful.” This was happening on embedded doubleclick ad URLs and other external ad URLs. I thought maybe there was some security setting that prevented cross-domain or cross-site loading of scripts or images, but that seemed to be a pretty extreme default setting for WebView. (IE many sites load jquery directly from the jquery site, or use content delivery networks for images… both are valid cross-domain references.)
The quick of it is, the custom ROM I had installed (Revolution ROM) came with some anti-spyware measures which was blocking certain sites and firing errors off to my WebViewClient. My stock /etc/hosts (/system/etc/hosts) file with this ROM looked something like this…
# Ad server list for use with hosts files to block ads # # For more information about this list, see: http://forum.xda-developers.com/showthread.php?t=509997 # ---- # entries: 23609 # last updated # AdFree Version 0.7.7 (7007) # UID: 0 # sources: http://www.mvps.org/winhelp2002/hosts.txt # http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts # # 127.0.0.1 localhost 127.0.0.1 0.r.msn.com 127.0.0.1 000-search.net 127.0.0.1 000dom.revenuedirect.com 127.0.0.1 005.free-counter.co.uk 127.0.0.1 006.free-counter.co.uk 127.0.0.1 007.free-counter.co.uk 127.0.0.1 008.free-counter.co.uk 127.0.0.1 008.free-counters.co.uk 127.0.0.1 00fun.com ...
I was able to change it back to a simple:
by following instructions here and the errors are gone. Guess that’s what I get for using a non-stock rom, but having root sure is worth it. 🙂