Hello. AdMob internal error log through logcat.

461 views
Skip to first unread message

Build Account

unread,
Jan 22, 2012, 3:27:34 AM1/22/12
to Google AdMob Ads Developers
Hello AdMob people.

Could you please analyze below and update your SDK
if you improve this case? I don't know exactly when this error
occured...

E/Ads(8797): An error occurred while loading data in AdWebView:
E/Ads(8797): java.lang.NullPointerException
E/Ads(8797): at
android.webkit.WebView.loadDataWithBaseURL(WebView.java:2312)
E/Ads(8797): at com.google.ads.h.loadDataWithBaseURL(SourceFile:128)
E/Ads(8797): at com.google.ads.c$c.run(SourceFile:142)
E/Ads(8797): at android.os.Handler.handleCallback(Handler.java:587)
E/Ads(8797): at android.os.Handler.dispatchMessage(Handler.java:92)
E/Ads(8797): at android.os.Looper.loop(Looper.java:130)
E/Ads(8797): at android.app.ActivityThread.main(ActivityThread.java:
3687)
E/Ads(8797): at java.lang.reflect.Method.invokeNative(Native Method)
E/Ads(8797): at java.lang.reflect.Method.invoke(Method.java:507)
E/Ads(8797): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:847)
E/Ads(8797): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
E/Ads(8797): at dalvik.system.NativeStart.main(Native Method)

Eric Leichtenschlag

unread,
Jan 25, 2012, 7:15:18 PM1/25/12
to google-adm...@googlegroups.com
Hello,

So this error is actually an Android WebView error that the SDK caught and logged to logcat as an error.  It did not crash the app, and I believe the only consequence of this error is no new ad was fetched on that given refresh cycle.

Cheers,
Eric, AdMob Team

nagamatu

unread,
Jan 26, 2012, 9:26:01 PM1/26/12
to Google AdMob Ads Developers
Dear Eric,

WebView.loadDataWithBaseURL has a possibility to cause
NullPointerException
when mWebViewCore is null. I assume that this can be caused by calling
loadDataWithBaseURL after destroy this WebView instance.

public void loadDataWithBaseURL(String baseUrl, String data,
String mimeType, String encoding, String failUrl) {

if (baseUrl != null &&
baseUrl.toLowerCase().startsWith("data:")) {
loadData(data, mimeType, encoding);
return;
}
switchOutDrawHistory();
HashMap arg = new HashMap();
arg.put("baseUrl", baseUrl);
arg.put("data", data);
arg.put("mimeType", mimeType);
arg.put("encoding", encoding);
arg.put("failUrl", failUrl);
mWebViewCore.sendMessage(EventHub.LOAD_DATA, arg);
clearTextEntry();
}

This is not the problem of Android framework. You need to fix AdMob
code.

--
nagamatu

On Jan 26, 9:15 am, Eric Leichtenschlag <eleichtens...@google.com>
wrote:

Eric Leichtenschlag

unread,
Jan 27, 2012, 5:15:47 PM1/27/12
to google-adm...@googlegroups.com
Nagamatu,

I believe it's a problem with the Android framework because it's not checking if mWebViewCore is null before calling sendMessage, which results in the crash.  The SDK just wraps the call to WebView.loadDataWithBaseURL, catches it, ogs the exception, and moves on.  It might be better if we didn't log the exception as an error (because it doesn't crash our SDK), but other than that I'm not sure why you think it's a problem with the SDK.

Cheers,
Eric

nagamatu

unread,
Jan 27, 2012, 8:00:41 PM1/27/12
to Google AdMob Ads Developers
Dear Eric,

Because this exception is occurred with wrong sequence of WebView
methods by SDK.

On Jan 28, 7:15 am, Eric Leichtenschlag <eleichtens...@google.com>
wrote:
Reply all
Reply to author
Forward
0 new messages