TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.59k stars 3.07k forks source link

Resolution/Subtitle Dropdown Open + Rotate = Crash #9643

Open Tex2002ans opened 1 year ago

Tex2002ans commented 1 year ago

Checklist

Affected version

0.26.1

Steps to reproduce the bug

0) Open a video.

1) Press Play (then optionally pause).

2) Click on the resolution/subtitle dropdown.

3) With resolution/subtitle dropdown open, rotate the screen.

Crash.

(This crashes both going from portrait -> landscape + landscape -> portrait.)

Expected behavior

Not crash.

Actual behavior

No response

Screenshots/Screen recordings

No response

Logs

Exception

java.lang.IllegalArgumentException: View=android.widget.PopupWindow$PopupDecorView{6241ddc V.E...... R.....ID 0,0-515,756} not attached to window manager
    at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:556)
    at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:445)
    at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:118)
    at android.widget.PopupWindow.update(PopupWindow.java:2210)
    at android.widget.PopupWindow.update(PopupWindow.java:2331)
    at android.widget.PopupWindow.alignToAnchor(PopupWindow.java:2501)
    at android.widget.PopupWindow.access$000(PopupWindow.java:106)
    at android.widget.PopupWindow$1.onViewAttachedToWindow(PopupWindow.java:240)
    at android.view.View.dispatchAttachedToWindow(View.java:20637)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3521)
    at android.view.ViewGroup.addViewInner(ViewGroup.java:5303)
    at android.view.ViewGroup.addView(ViewGroup.java:5089)
    at android.view.ViewGroup.addView(ViewGroup.java:5029)
    at android.view.ViewGroup.addView(ViewGroup.java:5001)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$tryAddVideoPlayerView$18(VideoDetailFragment.java:1341)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$ZzjLKhR2Gonsds2l69UGxn_Rrzc(Unknown Source:0)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda37.accept(Unknown Source:4)
    at j$.util.Optional.ifPresent(Unknown Source:4)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$tryAddVideoPlayerView$19(VideoDetailFragment.java:1336)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$LHqsaPsx9z979dNc2_7Xw3h43AY(Unknown Source:0)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda36.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:233)
    at android.app.ActivityThread.main(ActivityThread.java:8068)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)


Affected Android/Custom ROM version

Android 11 / OxygenOS 11.1.2.2

Affected device model

OnePlus 6T

Additional information

No response

seniorm0ment commented 1 year ago

I have had issues for the past few months. Rotating while a video is playing causes the app to crash. I have not noticed anything as far as resolution changes go. But this is a very aggravating bug and it also doesn't save position of the video.

GfEW commented 8 months ago

I can confirm this still crashes in 26.1 (UPDATE: 27.2), and add to it that the same crash (according to the error log, except for slighty different numbers) also gets triggered if the subtitle menu rather than resolution menu is open during auto rotation.

(The playback speed dialog can be rotated just fine.)

Exception

java.lang.IllegalArgumentException: View=android.widget.PopupWindow$PopupDecorView{8a9026c V.E...... R.....I. 0,0-643,288} not attached to window manager
    at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:485)
    at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:380)
    at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:101)
    at android.widget.PopupWindow.update(PopupWindow.java:2064)
    at android.widget.PopupWindow.update(PopupWindow.java:2185)
    at android.widget.PopupWindow.alignToAnchor(PopupWindow.java:2355)
    at android.widget.PopupWindow.access$000(PopupWindow.java:106)
    at android.widget.PopupWindow$1.onViewAttachedToWindow(PopupWindow.java:220)
    at android.view.View.dispatchAttachedToWindow(View.java:18376)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3484)
    at android.view.ViewGroup.addViewInner(ViewGroup.java:5157)
    at android.view.ViewGroup.addView(ViewGroup.java:4945)
    at android.view.ViewGroup.addView(ViewGroup.java:4885)
    at android.view.ViewGroup.addView(ViewGroup.java:4858)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$tryAddVideoPlayerView$41(VideoDetailFragment.java:1244)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$s-YSZ_fvw5kK3nBMjl4uKoby47w(VideoDetailFragment.java:0)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda66.accept(R8$$SyntheticClass:0)
    at j$.util.Optional.ifPresent(Unknown Source:4)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.lambda$tryAddVideoPlayerView$42(VideoDetailFragment.java:1239)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment.$r8$lambda$S8n3OzU8HWJ8m_WwgX_142JT8Zo(VideoDetailFragment.java:0)
    at org.schabi.newpipe.fragments.detail.VideoDetailFragment$$ExternalSyntheticLambda57.run(R8$$SyntheticClass:0)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6826)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)