Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issues] "Unable to find IAnimationManager for 'IeuanWalker.Maui.Switch.CustomSwitch'. (Parameter 'animatable')" #20

Open
ElegantCatterpillar opened this issue Sep 11, 2024 · 4 comments

Comments

@ElegantCatterpillar
Copy link

Good morning, I decided to install the library to replace the normal switch I had for this one because I like customization.

But when I installed it and placed it in a file the first time I started well, I stopped the project and I run it again and it does not compile and sends me that error that you see in the following screenshot

image

My code is the following:

MauiProgramExtensions.cs
builder.UseMauiApp<App>() .UseSwitch()

FooterOptions.xaml

`
<switch:CustomSwitch
x:Name="ThemeSwitch"
BackgroundColor="White"
HeightRequest="50"
HorizontalOptions="CenterAndExpand"
IsToggled="{Binding IsDarkTheme}"
KnobBackgroundColor="DeepPink"
KnobHeight="60"
KnobLimit="Boundary"
KnobWidth="60"
Toggled="Switch_Toggled"
VerticalOptions="CenterAndExpand"
WidthRequest="120">
switch:CustomSwitch.StrokeShape

</switch:CustomSwitch.StrokeShape>
switch:CustomSwitch.KnobStrokeShape

</switch:CustomSwitch.KnobStrokeShape>
switch:CustomSwitch.BackgroundContent




</switch:CustomSwitch.BackgroundContent>

                <switch:CustomSwitch.KnobContent>
                    <Grid
                        x:Name="KnobContent"
                        Margin="60,0,0,0"
                        ColumnDefinitions="60,60"
                        HeightRequest="50"
                        WidthRequest="120">
                        <Image
                            Grid.Column="0"
                            Aspect="AspectFit"
                            HeightRequest="30"
                            HorizontalOptions="Center"
                            Source="{mi:Material Icon=LightMode,
                                                 IconColor=Red}"
                            VerticalOptions="Center" />
                        <Image
                            Grid.Column="1"
                            Aspect="AspectFit"
                            HeightRequest="30"
                            HorizontalOptions="Center"
                            Source="{mi:Material Icon=DarkMode,
                                                 IconColor=Red}"
                            VerticalOptions="Center" />
                    </Grid>
                </switch:CustomSwitch.KnobContent>
            </switch:CustomSwitch>

`

Try cleaning up the solution, recompiling and even doing a manual cleanup by deleting the compiled files.

@IeuanWalker
Copy link
Owner

@ElegantCatterpillar that's strange, ive used it in a few projects, and have never seen this.

Can you create a small repo project

@ElegantCatterpillar
Copy link
Author

@ElegantCatterpillar that's strange, ive used it in a few projects, and have never seen this.

Can you create a small repo project

Hi @IeuanWalker , only happens in the android emulator, if I try it directly from my device I have no problems.

@IeuanWalker
Copy link
Owner

@ElegantCatterpillar strange, just based on the screenshot of the exception looks to be more of an environment issue, rather than an issue with this library.

The error says IAnimationManger is missing, which is just part of Maui - https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui.animations.ianimationmanager?view=net-maui-8.0

@ElegantCatterpillar
Copy link
Author

ElegantCatterpillar commented Sep 11, 2024

@IeuanWalker maybe, it can be the Maui Controls version. Im using

<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80" /> <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.80" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants