[Android SDK] Issues with the WebView

671 views
Skip to first unread message

r...@jwplayer.com

unread,
Sep 11, 2015, 2:45:59 PM9/11/15
to Interactive Media Ads SDK
Currently I am working on integrating the latest version of the IMA SDK in our JWPlayer Android SDK.
However while playing an Ad we see a lot of errors being thrown in the Logcat output.
These errors seem related to the IMA SDK.

I captured the following stacktrace:

09-11 14:08:14.059  32593-32593/com.longtailvideo.jwplayer.demo W/WebView﹕ java.lang.Throwable: A WebView method was called on thread 'main'. All WebView methods must be called on the same thread. (Expected Looper Looper (JavaBridge, tid 177) {f741167} called on Looper (main, tid 1) {3eebfc8}, FYI main Looper is Looper (main, tid 1) {3eebfc8})
            at android.webkit.WebView.checkThread(WebView.java:2286)
            at android.webkit.WebView.ensureProviderCreated(WebView.java:2268)
            at android.webkit.WebView.onVisibilityChanged(WebView.java:2509)
            at android.view.View.dispatchVisibilityChanged(View.java:9579)
            at android.view.ViewGroup.dispatchVisibilityChanged(ViewGroup.java:1292)
            at android.view.View.setFlags(View.java:10640)
            at android.view.View.setVisibility(View.java:7425)
            at com.google.ads.interactivemedia.v3.impl.a.f.b(IMASDK:34)
            at com.google.ads.interactivemedia.v3.impl.j.a(IMASDK:84)
            at com.google.ads.interactivemedia.v3.impl.z.b(IMASDK:145)
            at com.google.ads.interactivemedia.v3.impl.h$a.a(IMASDK:339)
            at com.google.ads.interactivemedia.v3.impl.w.f(IMASDK:511)
            at com.google.ads.interactivemedia.v3.impl.w.a(IMASDK:288)
            at com.google.ads.interactivemedia.v3.impl.x.b(IMASDK:132)
            at com.google.ads.interactivemedia.v3.impl.x$1.shouldOverrideUrlLoading(IMASDK:60)
            at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:331)
            at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:265)
            at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
            at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-11 14:08:14.149  32593-32593/com.longtailvideo.jwplayer.demo W/WebView﹕ java.lang.Throwable: A WebView method was called on thread 'main'. All WebView methods must be called on the same thread. (Expected Looper Looper (JavaBridge, tid 177) {f741167} called on Looper (main, tid 1) {3eebfc8}, FYI main Looper is Looper (main, tid 1) {3eebfc8})
            at android.webkit.WebView.checkThread(WebView.java:2286)
            at android.webkit.WebView.evaluateJavascript(WebView.java:993)
            at com.google.ads.interactivemedia.v3.impl.x.a(IMASDK:107)
            at com.google.ads.interactivemedia.v3.impl.w.e(IMASDK:644)
            at com.google.ads.interactivemedia.v3.impl.w.b(IMASDK:639)
            at com.google.ads.interactivemedia.v3.impl.h.a(IMASDK:293)
            at com.google.ads.interactivemedia.v3.impl.h.a(IMASDK:41)
            at com.google.ads.interactivemedia.v3.impl.h$a.a(IMASDK:358)
            at com.google.ads.interactivemedia.v3.impl.w.f(IMASDK:507)
            at com.google.ads.interactivemedia.v3.impl.w.a(IMASDK:288)
            at com.google.ads.interactivemedia.v3.impl.x.b(IMASDK:132)
            at com.google.ads.interactivemedia.v3.impl.x$1.shouldOverrideUrlLoading(IMASDK:60)
            at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:331)
            at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:265)
            at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
            at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-11 14:08:14.149  32593-32593/com.longtailvideo.jwplayer.demo W/WebView﹕ java.lang.Throwable: A WebView method was called on thread 'main'. All WebView methods must be called on the same thread. (Expected Looper Looper (JavaBridge, tid 177) {f741167} called on Looper (main, tid 1) {3eebfc8}, FYI main Looper is Looper (main, tid 1) {3eebfc8})
            at android.webkit.WebView.checkThread(WebView.java:2286)
            at android.webkit.WebView.evaluateJavascript(WebView.java:993)
            at com.google.ads.interactivemedia.v3.impl.x.a(IMASDK:107)
            at com.google.ads.interactivemedia.v3.impl.w.e(IMASDK:644)
            at com.google.ads.interactivemedia.v3.impl.w.b(IMASDK:639)
            at com.google.ads.interactivemedia.v3.impl.h.a(IMASDK:293)
            at com.google.ads.interactivemedia.v3.impl.h.destroy(IMASDK:222)
            at com.longtailvideo.jwplayer.core.GoogleIMA.GoogleIMAProvider.destroyAdsManager(GoogleIMAProvider.java:287)
            at com.longtailvideo.jwplayer.core.GoogleIMA.JWIMAEventListener.onAdEvent(JWIMAEventListener.java:57)
            at com.google.ads.interactivemedia.v3.impl.h.a(IMASDK:305)
            at com.google.ads.interactivemedia.v3.impl.h.a(IMASDK:298)
            at com.google.ads.interactivemedia.v3.impl.h$a.a(IMASDK:377)
            at com.google.ads.interactivemedia.v3.impl.w.f(IMASDK:507)
            at com.google.ads.interactivemedia.v3.impl.w.a(IMASDK:288)
            at com.google.ads.interactivemedia.v3.impl.x.b(IMASDK:132)
            at com.google.ads.interactivemedia.v3.impl.x$1.shouldOverrideUrlLoading(IMASDK:60)
            at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:331)
            at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:265)
            at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
            at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:148)
            at android.app.ActivityThread.main(ActivityThread.java:5417)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

We are a bit clueless on what's causing this. Any ideas?

Tyler Sidell (IMA SDK Team)

unread,
Sep 11, 2015, 5:05:43 PM9/11/15
to Interactive Media Ads SDK
Hi,

Thank you for providing the stack traces. Since the error you are receiving is "A WebView method was called on thread 'main'. All WebView methods must be called on the same thread.", could you explain to us your particular use case that is throwing this error?

To further troubleshoot, would you be able to let us know some steps that we can take to reproduce the issue (if you could provide code snippets that would be of great assistance)? Also are you noticing this on other versions of the SDK and is this occurring only on specific devices?

Thanks,
Tyler Sidell
IMA SDK Team

r...@jwplayer.com

unread,
Sep 14, 2015, 11:18:09 AM9/14/15
to Interactive Media Ads SDK
Hi Tyler,

Thanks for your early reply.

These stacktraces show up during (and after) the playback of an Google IMA Ad in the JW Player.
I have tried version v3.3.b21.1 and version3.3.b13.3 of the Google IMA SDK. And with both versions I experienced this issue.

I did not experience these issues with the AdvancedExample of the Google IMA SDK.

The thing I am wondering about is: does the Google IMA SDK do anything special in regard with the WebView?

We are currently working on a tiny demo app where we try to isolate the problem.
If we manage to isolate the problem we will share the code with you.

Kind regards,
Rik Heijdens

Tyler Sidell (IMA SDK Team)

unread,
Sep 14, 2015, 3:51:19 PM9/14/15
to Interactive Media Ads SDK
Hi Rik,

Can you elaborate when you ask if the SDK does "anything special" in regards to the WebView?  It is used to make ad requests, parse responses, ping tracking URLs, and render video ads. Since you are not experiencing the issue on our Advanced Example, it narrows it down that this issue is related to this specific implementation. Also it looks like the error is coming from 32593-32593/com.longtailvideo.jwplayer.demo.

Usually this error message is related to Javascript interface callbacks that are performed in a background thread  All Android View related methods should be called on the UI thread.  To help troubleshoot and investigate further, would you be able to provide specific steps so that we are able to reproduce the issue?  

Once you have code that you can share, please let us know.

Thanks,
Tyler Sidell
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages