The49.Maui.BottomSheet icon indicating copy to clipboard operation
The49.Maui.BottomSheet copied to clipboard

Invalid cast exception on android

Open AliKarimiENT opened this issue 1 year ago • 0 comments

Hey

this is the ModalSheet component:


<the49:BottomSheet
    HasBackdrop="True"
    HasHandle="False"
    IsCancelable="True"
    x:Name="BookingSheet"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:the49="https://schemas.the49.com/dotnet/2023/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
    <VerticalStackLayout HorizontalOptions="Fill" Padding="20">
        <Grid
            ColumnDefinitions="*,auto"
            HorizontalOptions="Fill"
            VerticalOptions="FillAndExpand">
            <Label
                FontSize="20"
                Grid.Column="0"
                Text="{x:Static resx:AppResources.AppointmentSheetHeader}" />
            <ImageButton
                Clicked="CloseButton_OnClicked"
                Grid.Column="1"
                Source="ic_close" />
        </Grid>
    </VerticalStackLayout>
</the49:BottomSheet>

and the given exception is:

System.InvalidCastException: Specified cast is not valid. at The49.Maui.BottomSheet.BottomSheetController.Callback_StateChanged(Object sender, EventArgs e) at The49.Maui.BottomSheet.BottomSheetCallback.OnStateChanged(View view, Int32 newState) at Google.Android.Material.BottomSheet.BottomSheetBehavior.BottomSheetCallback.n_OnStateChanged_Landroid_view_View_I(IntPtr jnienv, IntPtr native__this, IntPtr native_p0, Int32 p1) in C:\a_work\1\s\generated\com.google.android.material.material\obj\Release\net6.0-android\generated\src\Google.Android.Material.BottomSheet.BottomSheetBehavior.cs:line 146 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLI_V(_JniMarshal_PPLI_V callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, Int32 p1) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 176

and the version is 8.0.3

My maui version is also up to date

AliKarimiENT avatar Apr 22 '24 09:04 AliKarimiENT