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

[GB-mobile + Video block + Android 7.1] Crash when playing a video and rotate the device #9946

Closed
daniloercoli opened this issue May 27, 2019 · 5 comments

Comments

@daniloercoli
Copy link
Contributor

daniloercoli commented May 27, 2019

While testing #9941 I found out a crash of the GB editor that happens if you rotate the device when the video player is on the screen and tapping around.

See from secs 20 of the following video: https://cloudup.com/c1j8E6q0S-N

Steps to repro

  • Add a video block
  • Upload a video
  • Play the video
  • Rotate the device
  • Tap on the video

I guess this happened since the EditPostActivity is recreated on rotation.

Edited:
I was able to reproduce the problem only once on android 7.1. Testing on my Samsung S9 now doesn't show any problem rotating the device.

Stack trace:

2019-05-27 18:32:53.890 12869-12869/org.wordpress.android E/MessageQueue-JNI: android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@86518e9 is not valid; is your activity running?
        at android.view.ViewRootImpl.setView(ViewRootImpl.java:1040)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:381)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
        at android.widget.MediaController.show(MediaController.java:364)
        at android.widget.MediaController.show(MediaController.java:314)
        at com.brentvatne.react.ReactVideoView.onTouchEvent(ReactVideoView.java:178)
        at android.view.View.dispatchTouchEvent(View.java:13464)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.widget.ScrollView.dispatchTouchEvent(ScrollView.java:753)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:698)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1869)
        at android.app.Activity.dispatchTouchEvent(Activity.java:3486)
        at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:656)
        at android.view.View.dispatchPointerEvent(View.java:13712)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6093)
        at android.view.Vi
2019-05-27 18:32:53.890 12869-12869/org.wordpress.android D/AndroidRuntime: Shutting down VM
2019-05-27 18:32:53.891 14434-14481/? D/GOS:PackageDAO: setPkgData(), success: true
2019-05-27 18:32:53.891 14434-14481/? D/GOS:PackageDAO: setPkgData(), begin
2019-05-27 18:32:53.894 12869-12869/org.wordpress.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.wordpress.android, PID: 12869
    android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@86518e9 is not valid; is your activity running?
        at android.view.ViewRootImpl.setView(ViewRootImpl.java:1040)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:381)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
        at android.widget.MediaController.show(MediaController.java:364)
        at android.widget.MediaController.show(MediaController.java:314)
        at com.brentvatne.react.ReactVideoView.onTouchEvent(ReactVideoView.java:178)
        at android.view.View.dispatchTouchEvent(View.java:13464)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.widget.ScrollView.dispatchTouchEvent(ScrollView.java:753)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3215)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2838)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:698)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1869)
        at android.app.Activity.dispatchTouchEvent(Activity.java:3486)
        at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:656)
        at android.view.View.dispatchPointerEvent(View.java:13712)
2019-05-27 18:32:53.895 12869-12869/org.wordpress.android E/AndroidRuntime:     at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6093)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5871)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5320)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5373)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5339)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5498)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5347)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5555)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5320)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5373)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5339)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5347)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5320)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8364)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8297)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8258)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8479)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:198)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:326)
        at android.os.Looper.loop(Looper.java:181)
        at android.app.ActivityThread.main(ActivityThread.java:6981)
        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:1445)
@daniloercoli
Copy link
Contributor Author

I was not able to reproduce the problem my Samsung S9.
On my Android 7.1 i'm encountering problems while loading the video preview after the upload, it takes so long time and hangs the app. Not quite sure it's a problem of the Video block, but rather a problem on the device. Will investigate it, but lowering the severity of this issue.

@daniloercoli daniloercoli changed the title [GB-mobile + Video block] Crash when playing a video and rotate the device [GB-mobile + Video block + Android 7.1] Crash when playing a video and rotate the device May 29, 2019
@designsimply
Copy link
Contributor

@daniloercoli can we push the milestone for this to 12.9?

@daniloercoli daniloercoli modified the milestones: 12.7, 13.0 Jul 12, 2019
@daniloercoli
Copy link
Contributor Author

Moved this to 13.0, since 12.9 cut is on Monday. Also note that I was not able to reproduce the problem when I tried to re-test the issue a couple of days later.
In any case, Video block is still not available in wp-android, we're re-introducing it in 12.9, and the implementation is slightly different. I guess this problem reported here is outdated.

@jkmassel
Copy link
Contributor

I'm bumping this to 13.1 as part of the 13.0 code freeze.

If you'd like it to be released as part of 13.0, please merge it against release/13.0 then DM me, and I'll be happy to issue a new beta release! :)

@jkmassel jkmassel modified the milestones: 13.0, 13.1 Jul 30, 2019
@designsimply designsimply removed this from the 13.1 milestone Oct 10, 2019
@malinajirka
Copy link
Contributor

I've checked sentry and the crash hasn't occurred in the last 90 days. However, I found a looot (40+) of crashes with the same BadTokenException. I'll consider creating a new issue for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants