In our MAUI application, an ObjectDisposedException occurs when the device orientation is changed. This issue is specifically encountered on Android devices. The exception message states: "System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Microsoft.Maui.Platform.LayoutViewGroup'." The exception occurs on the line: GrialKit.NotifyConfigurationChanged(newConfig);. However, we have observed the same exception on multiple screens, and the object type mentioned in the exception is not always the same.
Steps to Reproduce
Open the application on an Android device.
Navigate to any screen with styles that change based on orientation.
Change the device orientation from portrait to landscape or vice versa.
Expected Behavior
The application should adjust to the new orientation without throwing any exceptions.
Actual Behavior
The application throws an ObjectDisposedException and may crash or behave unexpectedly.
Basic Information
Version with issue (.NET MAUI or Xamarin.Forms?): .NET MAUI
Description
In our MAUI application, an ObjectDisposedException occurs when the device orientation is changed. This issue is specifically encountered on Android devices. The exception message states: "System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Microsoft.Maui.Platform.LayoutViewGroup'." The exception occurs on the line: GrialKit.NotifyConfigurationChanged(newConfig);. However, we have observed the same exception on multiple screens, and the object type mentioned in the exception is not always the same.
Steps to Reproduce
Expected Behavior
The application should adjust to the new orientation without throwing any exceptions.
Actual Behavior
The application throws an ObjectDisposedException and may crash or behave unexpectedly.
Basic Information