New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 650157 link

Starred by 7 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()

Reported by subrahma...@gmail.com, Sep 26 2016

Issue description

Example URL:

Steps to reproduce the problem:
1. Load any youtube url in webview
2. it will crash
3. Happened in Android Nougat.

What is the expected behavior?

What went wrong?
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
                                                       at com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster(WebViewContentsClientAdapter.java:1181)
                                                       at org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run(DefaultVideoPosterRequestHandler.java:39)
                                                       at android.os.Handler.handleCallback(Handler.java:751)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:154)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Device: Nexus 6P
OS version: 7.0
Build Number: NRD90T

Did this work before? Yes in Marshmellow

Is it a problem with Flash or HTML5? N/A

Does this work in other browsers? N/A 

Chrome version: WebView  Channel: stable
OS Version: 7.0
Flash Version: Shockwave Flash 23.0 r0

Some more information:
                                         --------- beginning of crash
09-21 17:24:01.277 3752-4641/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
09-21 17:24:01.277 3752-4641/? W/google-breakpad: Chrome build fingerprint:
09-21 17:24:01.277 3752-4641/? W/google-breakpad: 1.3.418.Internal
09-21 17:24:01.277 3752-4641/? W/google-breakpad: 9
09-21 17:24:01.277 3752-4641/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
09-21 17:24:01.277 3752-4641/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 4641 (WorkerPool/4641)

                                       [ 09-21 17:24:01.278   377:  377 W/         ]
                                       debuggerd: handling request: pid=3752 uid=10133 gid=10133 tid=4641
 
Components: Mobile>WebView

Comment 2 Deleted

subrahmanyam.bpt@, 

-I tried to repro on stable/beta version of chrome/webview on Nexus 6p/NRD90T I was not able repro.

Can you please give us some more information?

1. what is application you are using to load the url? 
2. what is application version?
3. Can you please attach full logcat/bugreport?

Thanks
1. I am using webview
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
                                                       at com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster(WebViewContentsClientAdapter.java:1181)
                                                       at org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run(DefaultVideoPosterRequestHandler.java:39)
                                                       at android.os.Handler.handleCallback(Handler.java:751)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:154)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

--------- beginning of crash
09-21 17:24:01.277 3752-4641/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
09-21 17:24:01.277 3752-4641/? W/google-breakpad: Chrome build fingerprint:
09-21 17:24:01.277 3752-4641/? W/google-breakpad: 1.3.418.Internal
09-21 17:24:01.277 3752-4641/? W/google-breakpad: 9
09-21 17:24:01.277 3752-4641/? W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
09-21 17:24:01.277 3752-4641/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 4641 (WorkerPool/4641)

                                       [ 09-21 17:24:01.278   377:  377 W/         ]
                                       debuggerd: handling request: pid=3752 uid=10133 gid=10133 tid=4641
 

Where in webview i am trying to load youtube, dailymotion and vine video as string

Components: -Internals>Media
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 10 2016

Labels: -Needs-Feedback Needs-Review
Owner: satyavat...@chromium.org
Thank you for providing more feedback. Adding requester "satyavathir@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Review
Owner: ----
Status: Available (was: Unconfirmed)
Leaving this bug open, so someone could take a look at it & comment.
Thanks!

Labels: Needs-Feedback
Re #4, is this an application that we can access via the play store, or is it your pwn private project? Could you please attach more comprehensive logs? It looks like a resource loading issue, which we might be able to help you with, given more information.

Yes the app is available in play store. https://play.google.com/store/apps/details?id=com.skillvo 
Labels: -Arch-x86_64
In that app, tapping on a video takes me to an activity with the title Video, but displays either html source as text, or a blank page. No crash is observed.

Another question: what webview version do you have installed?
After going to video page again you need to click on Video so that the video will display in webview.

I am using Android 7.1 beta version. Exactly don't know which version it has.
I have the same error in my application on load video url into WebView.
Android 7.0, Nexus 5X. On Android API v21 everything is OK.
Stacktrace: 
com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster (WebViewContentsClientAdapter.java:1181)
org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run (DefaultVideoPosterRequestHandler.java:39)
android.os.Handler.handleCallback (Handler.java:751)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:154)
android.app.ActivityThread.main (ActivityThread.java:6077)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:865)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:755)
is there any way to work around this? webview crashing your app on random pages is pretty annoying. 
I think we were waiting for the webview version to be told us. Otherwise, yeah we will try to fix if it is in WebView.

You can learn the webview version in different ways. Since this is Android 7, assuming you are not using WebView beta channel, or disabled chrome, or switched to Chrome beta as webview provider, WebView version should be same as Chrome.


My chrome browser is Version 54.0.2840.85, Android 7.0, Build N5D91L on a Nexus 5X.
Same stacktrace as Comment 12.
This workaround fixed it for me:

mWebView.setWebChromeClient(new WebChromeClient() {

    @Override
    public Bitmap getDefaultVideoPoster() {
        final Bitmap defaultVideoPoster = super.getDefaultVideoPoster();
        return defaultVideoPoster != null
                ? defaultVideoPoster
                : Bitmap.createBitmap(1, 1, Bitmap.Config.RGB_565);
    }
            
});

Comment 17 by clh...@gmail.com, Feb 21 2017

I'm also seeing this on an Acer Chromebook running Android System Web View version 57.0.2987.54.

Stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
                                                                      at com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster(WebViewContentsClientAdapter.java:1197)
                                                                      at org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run(DefaultVideoPosterRequestHandler.java:39)
                                                                      at android.os.Handler.handleCallback(Handler.java:739)
                                                                      at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                      at android.os.Looper.loop(Looper.java:148)
                                                                      at android.app.ActivityThread.main(ActivityThread.java:5607)
                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Having same crash on phone OnePlus 3T with Android 7.0
Chrome version: 56.0.2924.87

In my app I am trying to load youtube video in webview via iFrame. Most interestingly other iframe videos like from Vimeo or Vine not crashing.

Here is my log:

FATAL EXCEPTION: main
                                     Process: im.example.app.debug, PID: 12245
                                     java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
                                         at com.android.webview.chromium.WebViewContentsClientAdapter.getDefaultVideoPoster(WebViewContentsClientAdapter.java:1196)
                                         at org.chromium.android_webview.DefaultVideoPosterRequestHandler$1.run(DefaultVideoPosterRequestHandler.java:39)
                                         at android.os.Handler.handleCallback(Handler.java:751)
                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                         at android.os.Looper.loop(Looper.java:154)
                                         at android.app.ActivityThread.main(ActivityThread.java:6209)
                                         at java.lang.reflect.Method.invoke(Native Method)
                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
In android version 7.1.2  beta Nexus 6P it's happening 100%
Project Member

Comment 20 by sheriffbot@chromium.org, Mar 9 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 21 by cmasso@google.com, Mar 29 2018

Is this still an issue?
Yup, this issue still exists. See b/77785437 for an example of this happening on a Google app.
Cc: tsergeant@chromium.org ntfschr@chromium.org
Labels: -Needs-Feedback
Status: WontFix (was: Untriaged)
tsergeant@ can we close this now that b/77785437 appears fixed?
We fixed b/77785437 by applying the workaround from #16. However, I think the underlying issue was caused by problems with Resources on our end (see b/78618107), rather than anything directly caused by the WebView.

So yup, I think it's reasonable to close this issue.

Sign in to add a comment