Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playing a video causes app crash [Android 7 - Lenovo] - caused by NullPointer in SurfaceView.updateWindow #7549

Open
4 tasks done
0xTyagi opened this issue Dec 18, 2021 · 12 comments
Labels
bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software player Issues related to any player (main, popup and background)

Comments

@0xTyagi
Copy link

0xTyagi commented Dec 18, 2021

Checklist

Steps to reproduce the bug

1.Open any video.
2. Play video.
3.Change Orientation (either automatically or manually). Or press the back button.
4. App crash

Actual behavior

App crash

Expected behavior

Videos must be played without any carsh

Screenshots/Screen recordings

Not required.

Logs

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: GB
  • Content Language: en
  • App Language: en_IN
  • Service: none
  • Version: 0.21.14
  • OS: Linux Android 7.0 - 24
Crash log

java.lang.RuntimeException: Unable to stop service org.schabi.newpipe.player.MainPlayer@264a0e5: java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.IWindowSession.performDeferredDestroy(android.view.IWindow)' on a null object reference
	at android.app.ActivityThread.handleStopService(ActivityThread.java:3344)
	at android.app.ActivityThread.-wrap27(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1570)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	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)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.IWindowSession.performDeferredDestroy(android.view.IWindow)' on a null object reference
	at android.view.SurfaceView.updateWindow(SurfaceView.java:658)
	at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:255)
	at android.view.View.dispatchDetachedFromWindow(View.java:15437)
	at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3222)
	at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4758)
	at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4732)
	at android.view.ViewGroup.removeView(ViewGroup.java:4663)
	at org.schabi.newpipe.player.MainPlayer.removeViewFromParent(MainPlayer.java:240)
	at org.schabi.newpipe.player.MainPlayer.cleanup(MainPlayer.java:187)
	at org.schabi.newpipe.player.MainPlayer.onDestroy(MainPlayer.java:178)
	at android.app.ActivityThread.handleStopService(ActivityThread.java:3327)
	... 8 more


@0xTyagi 0xTyagi added the bug Issue is related to a bug label Dec 18, 2021
@AudricV
Copy link
Member

AudricV commented Dec 18, 2021

What's your device and your device's ROM? It seems you removed this part when filling the template.

I couldn't reproduce this issue on my device (Honor 9X, EMUI 10.0/Android 10).

@AudricV AudricV added the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Dec 18, 2021
@Kariosfox
Copy link

I'm also experiencing this issue. I'm using a Lenovo P2a42 with Android 7.0.

@0xTyagi
Copy link
Author

0xTyagi commented Dec 19, 2021

OS: Android 24(7.0) stock
Device: Lenovo k33

@github-actions github-actions bot removed the waiting for author If the author doesn't respond, the issue will be auto-closed. Otherwise the label will be removed. label Dec 19, 2021
@0xTyagi

This comment has been minimized.

@0xTyagi
Copy link
Author

0xTyagi commented Dec 19, 2021

This comment may be helpful as this issues also have same crash signature.

lipangit/JiaoZiVideoPlayer#62 (comment)

@AudricV AudricV added player Issues related to any player (main, popup and background) device/software specific Issues that only happen on some devices or with some specific hardware/software labels Dec 19, 2021
@Kariosfox
Copy link

This issue is also present in the newest version 21.15.

@0xTyagi 0xTyagi changed the title Crash everytime version 0.21.14 Crash everytime version 0.21.14 and 0.21.15 Jan 17, 2022
@vit1307

This comment has been minimized.

@litetex
Copy link
Member

litetex commented Jan 23, 2022

#7549 (comment) is the same exception as in the issue

#7549 (comment) is an unrelated exception

Note: It looks like the problem only happens on Android 7.0 (as seen in the crash reports) and on Lenovo devices.

Analysis

The problem occurs inside the Android framework itself (likely here) however I was unable to located any source/branch which exactly matches the line numbers. So some kind of modification was likely done inside the class by the device manufacturer.

The problematic code is no longer present in Android 8+ and was likely fixed by a refactoring, adding a null check and the catching of all exceptions with this commit:
grafik

TL;DR
The problem is not fixable by us as it's a Android problem or a problem introduced by a modification from the manufacturer of the device (likely Lenovo).
Android 8+ provides a fix so I recommend updating the OS if possible.

@litetex litetex changed the title Crash everytime version 0.21.14 and 0.21.15 Playing a video causes app crash [Android 7 - Lenovo] - caused by NullPointer in SurfaceView.updateWindow Jan 23, 2022
@litetex
Copy link
Member

litetex commented Jan 24, 2022

In a duplicate issue the reporter stated that s/he also uses a Lenovo device - I'm now 99% sure that there is a bug in Lenovo's Android 7 OS.

@litetex litetex mentioned this issue Feb 17, 2022
5 tasks
@jjakob
Copy link

jjakob commented Feb 18, 2022

I have probably the same bug on LineageOS 14.1 Android 7.1.2
java.lang.NullPointerException: Attempt to invoke interface method 'void android.view.IWindowSession.finishDrawing(android.view.IWindow)' on a null object reference
at android.view.SurfaceView.updateWindow(SurfaceView.java:652)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:247)
at android.view.View.dispatchWindowVisibilityChanged(View.java:10358)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1290)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1544)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6344)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)\n\tat android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

@celikten
Copy link

celikten commented Feb 18, 2022

Reply to: #7549 (comment) (Mod-note: removed quote reply because it requires massive amounts of space)

As I remember correctly, the previous versions of the NewPipe versions (before 0.21.14) have worked properly. , and I loved putting something in the background and closing the phone screen.

Is this crash only related to the android version? Can not it be another bug?

@litetex
Copy link
Member

litetex commented Feb 20, 2022

Is this crash only related to the android version? Can not it be another bug?

→ see above

The problem is not fixable by us as it's a Android problem or a problem introduced by a modification from the manufacturer of the device (likely Lenovo).
Android 8+ provides a fix so I recommend updating the OS if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software player Issues related to any player (main, popup and background)
Projects
None yet
Development

No branches or pull requests

7 participants