-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Three finger screenshotting throws assert #20517
Comments
Please add the output of |
I can reproduce this in a release build, when tapping anywhere with 3 fingers. It does not crash when tapping with 1 or 2 fingers.
Update: Seems that its crashing on a OnePlus 5, but not on a Xiaomi A2. |
I even have more information. My phone has 3 finger screenshot gesture enabled. In debug mode the app does not crash, just in release mode. |
Same problem here, but I cannot reproduce the error as you described. |
Do you have a reliable way to reproduce this error? If so, can you post a minimal runnable code example that shows the error? That would help us tremendously in fixing this. |
My guess would be that some Android device is sending us bogus data (or at least data that we haven't thought to expect). Without knowing more about the device, steps to reproduce, or in general any more information, it's hard for us to do anything. If you see this, please try to provide such information, as well as an up to date stack trace and the output of |
@goderbauer reports that Android claims to make no promises regarding their events, so we must make the engine robust to arbitrary sequences of input events, and try to convey coherent events to the framework. |
I can reproduce this in a xiaomi 6X, when use the three-finger screenshot feature. |
Adding some additional paraphrasing from customers via WeChat: The Xiaomi OS (?) has a 3 finger screenshot function. When using it on Flutter, it turns into one ACTION_DOWN and one ACTION_POINTER_DOWN in FlutterView. On the dart side, that's 2 down. Then there's an ACTION_CANCEL but its getPointerCount is 3. When that reaches dart, it becomes 3 cancels which doesn't match the 2 from before. So far, it's only reproducible on a Xiaomi 6X. |
Hopefully we can buy one but I also strongly suspect that the bundled OS for Xiaomi phones domestically and on international versions are different. Maybe a OnePlus 5 as mentioned in #20517 (comment) is a safer bet. |
Here's the sequence of pointer events that Flutter is seeing when the user performs the three-finger screenshot gesture: Pointer 1 down The problem is that we get a cancel event for the third finger even though we never were told to track it. The fix is going to be to filter those "illegal" events out. |
I can also reproduce this error on a oneplus 3 using the three-finger screenshot feature. |
I'm pushing this to the Oct milestone. We plan to get to this ASAP but I've asked @chinmaygarde to finish up work on a higher-priority issue first. We realise this is impacting customers, and this is definitely very much on our radar. Thanks for your patience. |
@cbracken @chinmaygarde I wonder if there's any feasible workaround we can implement on our side or even an ugly fix would work for us. |
@sergicastellsague I posted the workaround a couple of comments above: #20517 (comment) |
Thanks, @goderbauer! however, when I tried it the code was not matching Flutter's code anymore, so it was not possible to simply apply the patch. I tried to adapt it, without luck. |
@shihaohong / @chunhtai do you see this happening in October 2019? |
Hi @sergicastellsague, I don't think this will be happening in October 2019. I just started looking at the issue and proposed solutions. @chunhtai will be back from vacation next week, so we will discuss what needs to get done when he returns. |
@shihaohong I understand. But this issue is really a pain for our users. It's causing a lot of crashes, not only on Android but iOS as well. I guess my users are not taking screenshots constantly, it's just by normal usage of the app that they touch the screen with 3 fingers and experience this crash. If the bugfix is not released, I'm more than willing to have a patch as a workaround, but I really need something to stop having them. Thanks a lot. |
@sergicastellsague Could you elaborate on how the patch that @goderbauer suggested failed to work? Your version of Flutter would certainly become a fork of the original, and that comes with the drawback of having to keep in sync with the official version. That would probably be the only workaround for it for as far as I know. |
In case somebody sees this crash and looks for a workaround, modify the file
in the
|
I can't find the handlePointerEvent method anymore. Can somebody help me? |
it got moved to the engine side, see |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Internal: b/143427192
On our released version of App, we were notified with an exception as the title show, the detail track infos are as follow:
NoSuchMethodError: The getter 'lastPosition' was called on null.
That's the full exception stack, from where I cannot get any info where my code got wrong because it's all about the framework layer, and I'm not very familiar with this layer.I did not found anything invoke the function _dispatchPointerDataPacket in hooks.dart from my code.
This exception appeared only once by now.
Can we avoid this by checking if it's null before invoking lastPosition in converter.dart ?
The text was updated successfully, but these errors were encountered: