the49ltd / The49.Maui.BottomSheet

.NET MAUI library used to display pages as Bottom Sheets
MIT License
325 stars 31 forks source link

net9 rc3: Could not inflate Behavior subclass com.google.android.material.bottomsheet.BottomSheetBehavior #137

Open softlion opened 2 weeks ago

softlion commented 2 weeks ago

I upgraded a project to net9 rc3, and when trying to display the bottom sheet, it is crashing with that message:

`the49_maui_bottom_sheet_design: Could not inflate Behavior subclass com.google.android.material.bottomsheet.BottomSheetBehavior`

Any idea how to workaround or fix ?

Using an android simulator Pixel5 API 34, and a maui app

related stack trace:

   at Android.Views.View.Inflate(Context context, Int32 resource, ViewGroup root) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net9.0/android-35/mcw/Android.Views.View.cs:line 17974
   at The49.Maui.BottomSheet.BottomSheetController.EnsureWindowContainer()
   at The49.Maui.BottomSheet.BottomSheetController.Show(Boolean animated)
   at The49.Maui.BottomSheet.BottomSheetManager.PlatformShow(Window window, BottomSheet sheet, Boolean animated)
   at The49.Maui.BottomSheet.BottomSheetManager.Show(Window window, BottomSheet sheet, Boolean animated)
   at The49.Maui.BottomSheet.BottomSheet.ShowAsync(Window window, Boolean animated)
softlion commented 2 weeks ago

Fixed here: https://github.com/softlion/The49.Maui.BottomSheet

SoureMaster commented 1 day ago

Looks like there are compatiblity issues.

Severity Code Description Project File Line Suppression State Error (active) NU1202 Package Vapolia.The49.Maui.BottomSheet 8.0.4-ci-11723878490 is not compatible with net9.0-maccatalyst18.0 (.NETCoreApp,Version=v9.0) / android-arm64. Package Vapolia.The49.Maui.BottomSheet 8.0.4-ci-11723878490 supports:

softlion commented 23 hours ago

Bottom sheet has never supported maccatalyst so I removed the tfm.

Remove maccatalyst from your targets.