pocket-casts-android
pocket-casts-android copied to clipboard
Crash when swiping Up to open Up Next
Description
We have had several reports that swiping up to open the Up Next queue is crashing the app in the 7.24-rc-1 release candidate.
I can intermittently reproduce this locally using my Pixel 3 running Android 12.
The stacktrace I get when I reproduce this locally matches this Sentry report. Interestingly though, that crash report is 100% from Android 13 users, but my test device sees the issue on Android 12.
Step-by-step reproduction instructions
- Open app
- Open full screen player
- Swipe up to open the Up Next queue
- 💥 Crash (this crash does not occur consistently for me though. It may happen more frequently when I swipe quickly, but I'm not sure about that)
Screenshots or screen recording
https://user-images.githubusercontent.com/4656348/194063928-f91e56b7-cfef-439b-abcf-59954e86fd31.mp4
Did you search for existing bug reports?
- [X] I have searched for existing bug reports.
Device, Operating system, and Pocket Casts app version
Sentry: 100% Android 13, 7.24-rc-1 My test device: Pixel 3 running Android 12
It appears that the problem is because the Android system is calling our onScroll
function with a null e1
argument. This should never happen because e1
is annotated as @NonNull
in the Android framework code:
boolean onScroll(@NonNull MotionEvent e1, @NonNull MotionEvent e2, float distanceX, float distanceY);
I wondered if the ViewPager might be capturing the onDown event, but I replaced the PlayerContainerFragment
(which has the ViewPager2
that loads the PlayerHeaderFragment
) to use the PlayerHeaderFragment
directly, and the crash still occurs for me. I also tried disabling dragging on the PlayerBottomSheet
to see if the drag detection for opening/closing the PlayerHeaderFragment
might be creating the problem, but the crash still occurred. This seems to strongly indicate that the problem is within PlayerHeaderFragment
(or within the Android system).
Noticed that I can open the up next queue from the button on the miniplayer, swipe that away with no problems, then open the full screen player, and have it crash when I swipe to open the up next queue.
I have a way to avoid the crash, but it can cause the up next queue swipe motion to not work sometimes. That is better than crashing, but I'd much rather find a proper fix.
Here's a video of the worst-case scenario with this fix. It's rare, but it's a pretty bad user experience.
Video
https://user-images.githubusercontent.com/4656348/194158283-a6c9004c-0b84-4701-87ce-88101be2d151.mp4
It is a known Android(API33) bug: https://issuetracker.google.com/issues/248212163 https://issuetracker.google.com/issues/206855618
Another report in 5606905-zen
When swiping up from now playing screen (to get to queue) app immediately crashes to launcher home screen.
+1 on 5607543-zd-woothemes
A fix for this will be included in the second 7.24 release candidate, which we are working on releasing to our open testers as soon as possible (Google is not cooperating).
Closing this as fixed by https://github.com/Automattic/pocket-casts-android/pull/375