Re: java.lang.NullPointerException at android.webkit.WebViewClassic.setBaseLayer(WebViewClassic.java...)

1,136 views
Skip to first unread message

William Ferguson

unread,
Jan 2, 2013, 6:05:48 PM1/2/13
to google-adm...@googlegroups.com
OK,

WebView exceptions are an unfortunate fact of mobile advertising on Android. All Ad networks use WebView for display because it allows them endless malleability of display and interaction. But WebView (at least historically) has been really flakey (IMHO).

These types of crashes seem to be far more numerous on Gingerbread devices. In my experience they rarely occur on ICS+, but they do happen.

If you want to use advertising I don't know of any way to avoid or mitigate these exceptions. Eric?

William


On Wednesday, January 2, 2013 11:58:30 PM UTC+10, Stefan Diener wrote:
I published an Android application that displays AdMob ads and uses ACRA for crash reporting. Now I got a strange crash report:

java.lang.NullPointerException
at android.webkit.WebViewClassic.setBaseLayer(WebViewClassic.java:5377)
at android.webkit.WebViewClassic.setNewPicture(WebViewClassic.java:10781)
at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:10012)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)

The report was sent from a Samsung Galaxy S3 (GT-I9300) running Android 4.1.1. The report is strange (from my point of view) because my app doesn't use a WebView. Furthermore the stack trace doesn't include any of my packages.

I talked to other Android developers and our suspicion is that the AdMob SDK produced the exception. I'm using AdMob SDK 6.2.1.

Has anybody else encountered this (or a very similar) stack trace? Why is this exception thrown? And what can I do to avoid the exception? Any help is really appreciated.

Eric Leichtenschlag

unread,
Jan 7, 2013, 2:25:00 PM1/7/13
to google-adm...@googlegroups.com
This looks like another case where the mWebViewCore is null - meaning the webView gets destroyed but webview methods are somehow still getting called. We'll see if we can do anything about this one. In the meantime, if you haven't done so already, try to call adView.destroy() in your activity's onDestroy() method. That way we can do as much cleanup on our end before the webview gets destroyed.

Thanks,
Eric

--
 
 
  

Kenny Chapman

unread,
Jan 7, 2013, 9:04:48 PM1/7/13
to google-adm...@googlegroups.com
I am also getting this same error. My adview is in a fragment, could it be a case of the adview still calling methods after the fragment is detached from the activity?
Reply all
Reply to author
Forward
0 new messages