jsuarezruiz / Xamanimation

Xamarin Forms Animation Library
MIT License
458 stars 57 forks source link

Xaml only animations fail to load Xamanimation.dll #4

Open blamejane opened 7 years ago

blamejane commented 7 years ago

After creating a new cross-platform project/solution and adding the Xamanimation reference (nuget) to the PCL, when deploying to iOS the application crashes with the following exception:

Xamarin.Forms.Xaml.XamlParseException: Position 8:14. Type xamanimation:FadeToAnimation not found in xmlns clr-namespace:Xamanimation;assembly=Xamanimation

If I add the following to the xaml code behind the application will load on iOS:

FadeBox.Animate(new FadeToAnimation());'

Using the Xamanimation Sample project you can test this same behavior by commenting out the code below IntializeComponent() in the AnimationsView.xaml.cs file. That is, comment out the AnimationExtensionButton click event handler code. By commenting out the code, the Xamanimation.dll will no longer load and the sample app will crash at startup.

JeromeGsq commented 6 years ago

Hello,

I've got the same problem. I have to call my new animation in the xaml code behind one time, build & run it on simulator then remove the line in order to use it. After that, my custom animation is working.

Hope it helps

PostImpatica commented 6 years ago

I got this on Android because I forgot to add the Xamanimation package to my project.

tarcisiosouzabr commented 6 years ago

Hey, @JeromeGsq @blamejane I've got the same problem. But i correct forcing the project load with this line : var a = new Xamanimation.HeartAnimation(); on AppDelegate.cs before LoadApplication().

jsuarezruiz commented 5 years ago

Will include an option to avoid this issue. For now, just adding the reference to the .NET library and the platform projects must fix the problem.

softlion commented 4 years ago

Search for LinkerPlzInclude, disable linking, or use the Preserve attribute.

This is not an issue with this lib.