2012-06-02 287 views
0

我把admob放在一個應用程序中,我測試了它,它在模擬器中正常工作,廣告顯示,但是當我嘗試檢查它是否在我的手機上正常工作時,廣告不顯示,我得到這些在logcat中的錯誤消息:AdMob不會顯示廣告

06-02 10:30:58.405: W/Ads(6148): IOException connecting to ad url. 
06-02 10:30:58.405: W/Ads(6148): java.net.ConnectException: failed to connect to googleads.g.doubleclick.net/127.0.0.1 (port 80): connect failed: ECONNREFUSED (Connection refused) 
06-02 10:30:58.405: W/Ads(6148): at libcore.io.IoBridge.connect(IoBridge.java:114) 
06-02 10:30:58.405: W/Ads(6148): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192) 
06-02 10:30:58.405: W/Ads(6148): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459) 
06-02 10:30:58.405: W/Ads(6148): at java.net.Socket.connect(Socket.java:842) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:77) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:351) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:86) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpConnection.connect(HttpConnection.java:128) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:308) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpEngine.connect(HttpEngine.java:303) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:282) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:232) 
06-02 10:30:58.405: W/Ads(6148): at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80) 
06-02 10:30:58.405: W/Ads(6148): at com.google.ads.internal.f.b(SourceFile:428) 
06-02 10:30:58.405: W/Ads(6148): at com.google.ads.internal.f.run(SourceFile:399) 
06-02 10:30:58.405: W/Ads(6148): at java.lang.Thread.run(Thread.java:856) 
06-02 10:30:58.405: W/Ads(6148): Caused by: libcore.io.ErrnoException: connect failed: 
.................. 

手機連接到無線網絡和互聯網工作正常。

編輯: 它沒有工作的原因是因爲我運行自定義ROM並且它阻止了所有廣告,解決方法是編輯hosts文件並從中刪除所有的廣告攔截! :)

+0

如果我限制他們的程序,未封鎖廣告的普通用戶將遭受:( – Kostadin

回答

2

這是您的手機端的問題,而不是您的代碼IMO,嘗試啓用飛行模式幾秒鐘,然後禁用它。