1

admob SDK (6.1.0) を使用して、onActivityCreated() の各フラグメントに次のコードを含むカスタム ListFragments の上に 2 つのバナーを表示しています。

LinearLayout adLayout = new LinearLayout(getActivity());
adView = new AdView(getActivity(), AdSize.SMART_BANNER, "xxxxxxxxxxxxx");
adView.loadAd(new AdRequest());
adLayout.addView(adView);
getListView().addHeaderView(adLayout);

ジンジャーブレッドの古い LG Optimus 2X ではすべて正常に動作しますが、ジェリービーンの Samsung Galaxy S3 を使用すると、広告が表示されなくなります。次のエラーが表示されます。

09-24 23:07:35.661: I/Ads(24043): Refreshing ad.
09-24 23:07:35.691: I/webclipboard(24043): clipservice: android.sec.clipboard.ClipboardExManager@42a88b90
09-24 23:07:35.696: V/webkit(24043): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {42cc0c00}
09-24 23:07:35.726: I/Ads(24043): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL({"kw":[],"preqs":2,"session_id":"16934128083720156505","u_sd":2,"seq_num":"3","slotname":"xxxxxxxxxxxx","u_w":360,"msid":"com.thiost.android.twire","js":"afma-sdk-a-v6.1.0","toar":2,"mv":"8014017.com.android.vending","isu":"605557A27D3A2A6A54663D68CFF48311","cipa":0,"format":"320x50_mb","net":"wi","app_name":"903.android.com.thiost.android.twire","hl":"nl","u_h":640,"carrier":"20404","ptime":120187,"u_audio":3});</script></head><body></body></html>
09-24 23:07:35.916: E/Ads(24043): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1)
09-24 23:07:35.916: E/Web Console(24043): Uncaught ReferenceError: AFMA_getSdkConstants is not defined:1
09-24 23:08:35.716: I/Ads(24043): AdLoader timed out after 60000ms while getting the URL.
09-24 23:08:35.721: D/webviewglue(24043): nativeDestroy view: 0x531a3420
09-24 23:08:35.726: I/Ads(24043): onFailedToReceiveAd(A network error occurred.)
09-24 23:09:35.786: I/Ads(24043): Refreshing ad.
09-24 23:09:35.811: I/webclipboard(24043): clipservice: android.sec.clipboard.ClipboardExManager@42a88b90
09-24 23:09:35.821: V/webkit(24043): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {42d893c0}
09-24 23:09:35.851: I/Ads(24043): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL({"kw":[],"preqs":3,"session_id":"16934128083720156505","u_sd":2,"seq_num":"4","slotname":"xxxxxxxxxxxx","u_w":360,"msid":"com.thiost.android.twire","js":"afma-sdk-a-v6.1.0","toar":3,"mv":"8014017.com.android.vending","isu":"605557A27D3A2A6A54663D68CFF48311","cipa":0,"format":"320x50_mb","net":"wi","app_name":"903.android.com.thiost.android.twire","hl":"nl","u_h":640,"carrier":"20404","ptime":240317,"u_audio":3});</script></head><body></body></html>
09-24 23:09:35.881: D/dalvikvm(24043): GC_CONCURRENT freed 1150K, 26% free 14863K/20039K, paused 6ms+5ms, total 50ms
09-24 23:09:35.996: E/Ads(24043): JS: Uncaught ReferenceError: AFMA_getSdkConstants is not defined (about:blank:1)
09-24 23:09:35.996: E/Web Console(24043): Uncaught ReferenceError: AFMA_getSdkConstants is not defined:1

アプリが WiFi 接続で初めて追加をロードしたときにのみ、このエラーが発生します。それ以外の場合は常に、WiFi で次のエラーが表示されます。

09-25 17:29:37.600: W/Ads(23165): IOException connecting to ad url.
09-25 17:29:37.600: W/Ads(23165): java.net.ConnectException: failed to connect to googleads.g.doubleclick.net/127.0.0.1 (port 80): connect failed: ECONNREFUSED (Connection refused)
09-25 17:29:37.600: W/Ads(23165):   at libcore.io.IoBridge.connect(IoBridge.java:114)
09-25 17:29:37.600: W/Ads(23165):   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
09-25 17:29:37.600: W/Ads(23165):   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
09-25 17:29:37.600: W/Ads(23165):   at java.net.Socket.connect(Socket.java:842)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpConnection.<init>(HttpConnection.java:76)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:341)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
09-25 17:29:37.600: W/Ads(23165):   at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)
09-25 17:29:37.600: W/Ads(23165):   at com.google.ads.internal.f.b(SourceFile:459)
09-25 17:29:37.600: W/Ads(23165):   at com.google.ads.internal.f.run(SourceFile:430)
09-25 17:29:37.600: W/Ads(23165):   at java.lang.Thread.run(Thread.java:856)
09-25 17:29:37.600: W/Ads(23165): Caused by: libcore.io.ErrnoException: connect failed: ECONNREFUSED (Connection refused)
09-25 17:29:37.600: W/Ads(23165):   at libcore.io.Posix.connect(Native Method)
09-25 17:29:37.600: W/Ads(23165):   at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
09-25 17:29:37.600: W/Ads(23165):   at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
09-25 17:29:37.600: W/Ads(23165):   at libcore.io.IoBridge.connect(IoBridge.java:112)
09-25 17:29:37.600: W/Ads(23165):   ... 16 more

モバイルインターネット接続ではエラーは発生しません...

4

1 に答える 1

4

私は問題が何であるかを理解しました。広告をブロックしていた新しいhostsファイルをインストールした新しいROMをフラッシュしました...hostsファイルを削除した後、広告が表示されました

于 2012-10-02T16:41:03.973 に答える