UXDivers / Grial-UI-Kit-Support

This is our public repository for customers to report bugs about Grial UI Kit for Xamarin Forms
61 stars 26 forks source link

ObjectDisposedException when changing orientation on Android #866

Open francois-junker opened 4 months ago

francois-junker commented 4 months ago

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

  1. Open the application on an Android device.
  2. Navigate to any screen with styles that change based on orientation.
  3. 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