Skip to content

Crash App when change ControlTemplate and click item in Android App MAUI #22229

Closed

Description

Description

I have a ControlTemplate in a CustomView, which will receive two StackLayout StaffLayout and AdminLayout.

When I click Staff Tab, it will assign ControlTemplate with StaffLayout and I click item in layout, it will normal. And then change to click Admin Tab, it will assign ControlTemplate with AdminLayout.
Error occur when I click again to Staff Tab , and then click to item in layout, the app is crashed and error comeout in debug section.

I place debug breakpoint in when assign ControlTemplate and see that ControlTemplate updated to another one, and Item in it changes when tab changes. But when I click in item, the error occur. And this error only happen in Android platform, this work normal on iOS platform.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.6 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 and up

Did you find any workaround?

No response

Relevant log output

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Microsoft.Maui.Platform.MauiTextView'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-xamlXAML, CSS, Triggers, Behaviorslegacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editorplatform/android 🤖s/needs-reproAttach a solution or code which reproduces the issuet/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions