Xamarin.Forms.InputKit icon indicating copy to clipboard operation
Xamarin.Forms.InputKit copied to clipboard

MAUI: App crash due to "Unable to find IAnimationManager for 'Microsoft.Maui.Controls.Shapes.Path'. Arg_ParamName_Name, animatable" by using inputkit:RadioButton

Open satish-dnv opened this issue 2 years ago • 3 comments

Describe the bug

Hi, I am encountering a critical issue in my .NET MAUI app when using the RadioButton from InputKit.MAUI package. The app crashes with the following error message:

"Unable to find IAnimationManager for 'Microsoft.Maui.Controls.Shapes.Path'. Arg_ParamName_Name, animatable"

This issue has been identified through logs in Sentry and is causing the app to become unusable. The App crashes in both Android and iOS.

To Reproduce Steps to reproduce the behavior:

  1. Use InputKit:RadioButton in XAML file.
  2. Build and deploy the app in release mode.
  3. Open the application, login with credentials and close the app.
  4. Try to open the application again by tapping on it.
  5. App crash at dashboard page, throwing the error in sentry logs.

Expected behavior Should be able to open the app unlimited times without a crash.

Screenshots Screenshot 2023-11-20 at 10 11 46 AM

Smartphone (please complete the following information):

  • Device: [iPhone 13]
  • OS: [17.1.1]
  • Device: [Android]
  • OS: [13] Additional context maui-ios 7.0.101/7.0.100 SDK 7.0.300
    maui-android 7.0.101/7.0.100 SDK 7.0.300

satish-dnv avatar Nov 20 '23 05:11 satish-dnv

Hi @enisn! We successfully addressed the bug by tweaking the code in the "src/InputKit.Maui/Shared/Controls/RadioButton.cs" file. Specifically, we replaced the iconChecked.ScaleTo(isChecked ? DOT_FULL_SCALE : 0, 180); with the following code: if (isChecked) { iconChecked.Scale = DOT_FULL_SCALE; } else { iconChecked.Scale = 0; } While this solution resolves the bug, it does impact the animation effect. We recommend investigating and refining the ScaleTo() function for a more seamless animation experience.

Thanks!

satish-dnv avatar Nov 22 '23 11:11 satish-dnv

Thanks for the detailed information, We have faced this issue before in earlier version of MAUI https://github.com/dotnet/maui/issues/3353#issuecomment-1078861688

I'll investigate it again and if it happens in MAUI, I'll open an issue to dotnet/maui repo again

enisn avatar Nov 22 '23 11:11 enisn

My issue is a nearly identical problem. While the above comment did help me lead to a solution it was too abstract so I am going to add clarity to this comment. The easiest way to reproduce this bug is by attempting to set .IsChecked = true in the constructor of View/Page. This has to do with the nature of animation triggering from .IsChecked.

public MainPage()
{
	InitializeComponent();
	CheckBox.IsChecked = true;
}

To get around this, you need to use the Loaded event handle for your View/Page because animations can be performed once the View/Page is loaded.

private void ContentPage_Loaded(object sender, EventArgs e)
{
	CheckBox.IsChecked = true;
}

I am not aware of how to skip the animation by turning it off; however, I have a gut feeling it might be impossible to do so and is required to make the checkmark.

jbeen25 avatar Jul 03 '24 03:07 jbeen25