Open sis2004 opened 5 years ago
Similar issue https://github.com/AndreiMisiukevich/ContextMenu/issues/4
android.runtime.JavaProxyThrowable: System.InvalidCastException: Specified cast is not valid. at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00007] in <7999cc4bd5664eca8a72469344172ca3>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild
StackLayout is passed instead of scrollView.
any update ?
Description
When I use CarouselView inside a ListView (where each cell has its own carousel view), it crashes in an Android emulator with the following exception:
Full stack trace
When I debugged it using a local Xamarin.Forms nuget package built from the latest master, I noticed that the children of the CarouselView (
newChildren
) were not in the same order as the corresponding renderers (_childViews
) in theVisualElementPackager.SetElement
method, which caused the FrameRenderer to be applied to the ContentView that resulted in this exception.The image below illustrates this issue, where the Frame-based arrow controls and the indicator are the last 3 children, while their (frame) renderers are the first 3 elements in the _childViews.
Do you have any ideas on what's causing this, and how it can be fixed?
Note: This issue has been reported in the corresponding CardView repository, and the author agreed that it seems to be a Xamarin.Forms bug.
Steps to Reproduce
Expected Behavior
The form should scroll through items without crashing.
Actual Behavior
After some swiping the app crashes with the exception above.
Basic Information