2012年4月29日日曜日

webcore: Can't get the viewWidth after the first layout

webcore: Can't get the viewWidth after the first layout

AdMobを使用すると、広告は正常に表示されるにも関わらず、標題の警告がLogCatに出ます。AdMobのSDKは4.3.1及び6.0.0で確認しました。

この警告を発出しているcodeは、android.webkit.WebViewCoreに掲載されているのではないかと思われます。関係する部分は次のとおりです。
2097        // now notify webview
2098        // webViewWidth refers to the width in the view system
2099        int webViewWidth;
2100        // viewportWidth refers to the width in the document system
2101        int viewportWidth = mCurrentViewWidth;
2102        if (viewportWidth == 0) {
2103            // this may happen when WebView just starts. This is not perfect as
2104            // we call WebView method from WebCore thread. But not perfect
2105            // reference is better than no reference.
2106            webViewWidth = mWebView.getViewWidth();
2107            viewportWidth = (int) (webViewWidth / adjust);
2108            if (viewportWidth == 0) {
2109                Log.w(LOGTAG, "Can't get the viewWidth after the first layout");
2110            }
2111        } else {
2112            webViewWidth = Math.round(viewportWidth * mCurrentViewScale);
2113        }

WebViewを別のスレッドで起動させたばっかりなので、必要なデータを取得できない状況です、ということでしょうか。
警告のログを発出しただけであって、処理は継続しているので、事実上問題は無いでしょう。
LogCatに表示されるのは次の趣旨のとおりです。
W/webcore: Can't get the viewWidth after the first layout
I/Ads: Received ad url:(省略)
W/webcore: Can't get the viewWidth after the first layout
I/Ads: onReceiveAd()
webcoreが発出する警告に引き続き、その警告を否定するかのように、Adsが「受け取った」という趣旨の情報を発出しています。
しかし、Adsは情報を発出してはいるものの、webcoreの警告との関連性まで言及していません。
本当に問題が無いのであれば、その旨の情報をどこかに掲載して頂ければ幸いです。

0 件のコメント:

コメントを投稿