Open Toomas75 opened 7 months ago
Hi @Toomas75. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Do you a repro sample or maybe more logs or details?
No repro. It's live app crashlog from appcenter. It happens occasionally. I see these after upgrade to .net 8.
This override was added in this PR: https://github.com/dotnet/maui/pull/16530
Not sure if this is related.
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
This override was added in this PR: #16530
Not sure if this is related.
I'm not using an Entry control or soft keyboard but I'm also seeing a few crash reports with similar stack traces from the last two published versions of my app using Maui 8.0.7 and 8.0.6. My app wasn't published with earlier versions. According to my Crashlytics logs, it looks like I'm on a screen using an SKGLTextureView but that's all know at this point.
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mPrivateFlags' on a null object reference in method 'boolean android.view.ViewGroup.resetCancelNextUpFlag(android.view.View)' at android.view.ViewGroup.resetCancelNextUpFlag(ViewGroup.java:2895) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2800) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3121) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2802) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:500) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1912) at android.app.Activity.dispatchTouchEvent(Activity.java:4299) at crc6488302ad6e9e4df1a.MauiAppCompatActivity.n_dispatchTouchEvent(MauiAppCompatActivity.java) at crc6488302ad6e9e4df1a.MauiAppCompatActivity.dispatchTouchEvent(MauiAppCompatActivity.java:57) at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:458) at android.view.View.dispatchPointerEvent(View.java:15309) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6778) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6578) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6034) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6091) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6057) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6222) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6065) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6279) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6038) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6091) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6057) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6065) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6038) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9206) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9157) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9126) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9329) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:267) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loopOnce(Looper.java:161) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7918) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
I've seen it on Android 11 and 13 devices and on Pixels, Vivos and Oppos so far.
@mattleibow Ignore my speculation regarding the SKGLTextureView. But I'm not using an Entry control or soft keyboard. If this is related to just touching the screen background or the root view (only guessing from the java stack trace), then the only place that I think this could be relevant in my app would be when tapping the background to close the fly out. I'm using a navigation page without shell.
@Toomas75
I was able to recreate the issue in my app. It is related to multi-touch where the second touch destroys the view or page etc.
It seems to be an Android issue, not a MAUI one.
This article on Medium explains what's going on very well.
I couldn't recreate the issue with 2 stock MAUI buttons. MAUI actually seems pretty robust there. I had some custom Android handlers that had their own touch listeners and those were causing the problem.
I attempted to fix the issue by setting android:splitMotionEvents to false, but that didn't work.
Since my controls didn't require multi-touch, I disabled it within my handlers:
if (e.Event.PointerCount > 0 && e.Event.GetPointerId(0) > 0 ) { e.Handled = true; return; };
@NatWobble Thank you for the information! It's normal app behavior to close view on button click. App was developed in xamarin forms then upgraded to .net7 and now .net8. Prior .net8 this crash never happened. And stack shows: MauiAppCompatActivity.dispatchTouchEvent MauiAppCompatActivity.java, line 57 Haven't searched the maui code, but maybe it's possible to check if the view still exists before calling/dispatching touchEvent.
@mattleibow Ignore my speculation regarding the SKGLTextureView. But I'm not using an Entry control or soft keyboard. If this is related to just touching the screen background or the root view (only guessing from the java stack trace), then the only place that I think this could be relevant in my app would be when tapping the background to close the fly out. I'm using a navigation page without shell.
@NatWobble your suggestion about the flyout helped me solve my issue.
I was having the same issue, I added popup before navigating to a new page. originally the popup close was after the navigation, that's when this error started. I moved the close of the popup to before the navigation to the new page and everything works as expected.
Still an issue, but only on Android 8.1 devices. On android 10,12,13,14 does not happen
Description
Steps to Reproduce
8.0.10 nightly
Link to public reproduction project repository
No response
Version with bug
Nightly / CI build (Please specify exact version)
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
android 8.1
Did you find any workaround?
No response
Relevant log output
No response