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
,
Sep 26 2016
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
,
Sep 27 2016
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
,
Sep 27 2016
,
Oct 10 2016
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
,
Oct 14 2016
Leaving this bug open, so someone could take a look at it & comment. Thanks!
,
Nov 3 2016
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.
,
Nov 3 2016
Yes the app is available in play store. https://play.google.com/store/apps/details?id=com.skillvo
,
Nov 3 2016
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?
,
Nov 3 2016
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.
,
Nov 3 2016
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)
,
Nov 18 2016
is there any way to work around this? webview crashing your app on random pages is pretty annoying.
,
Nov 18 2016
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.
,
Nov 18 2016
My chrome browser is Version 54.0.2840.85, Android 7.0, Build N5D91L on a Nexus 5X. Same stacktrace as Comment 12.
,
Dec 21 2016
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);
}
});
,
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)
,
Feb 28 2017
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)
,
Mar 2 2017
In android version 7.1.2 beta Nexus 6P it's happening 100%
,
Mar 9 2018
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
,
Mar 29 2018
Is this still an issue?
,
Apr 18 2018
Yup, this issue still exists. See b/77785437 for an example of this happening on a Google app.
,
Aug 1
tsergeant@ can we close this now that b/77785437 appears fixed?
,
Aug 1
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 |
||||||||
Comment 1 by rsgav...@chromium.org
, Sep 26 2016