Maui.Controls.Compatibility.StackLayout; add children, chidlren.clear, re-add children -> System.Object.DisposedException #22575
Labels
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
migration-compatibility
Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert
platform/android 🤖
s/needs-attention
Issue has more information and needs another look
t/bug
Something isn't working
Milestone
Description
On Android -14-Simulator I get "System.ObjectDisposedException" after re-adding a Microsoft.Maui-Compatibility.StackLayout to another Stacklayout.
iOS-Simulator: OK
Tizen: not testet
Mac: not testet
Windows: not tested because of "The handler's Maui-Context cannot be null."-Exception during UseMauiCompatibility
Steps to Reproduce
Create Sample-Maui-Project, replace MainPage with this:
using CStackLayout=Microsoft.Maui.Controls.Compatibility.StackLayout;
namespace MauiApp1
{
}
Change to Android-Simulator, start program, press "Update"-Button -> Exception is thrown
Btw:
But I migrate from Xamarin, so I have to use Compatibility.
Java.Lang.IllegalStateException: 'The specified child already has a parent. You must call removeView() on the child's parent first.'
I hope that's the same problem...
Link to public reproduction project repository
https://github.com/HoGo72/MauiCompatibilityStacklayoutCrash.git
Version with bug
8.0.40 SR5
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 14
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: