behaviors
behaviors copied to clipboard
Crashing on relase, working on debug
Hello !
I have declared in many pages something like this:
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="xxx.Views.SplashPage"
xmlns:behaviors="clr-namespace:Behaviors;assembly=Behaviors"
xmlns:viewModelBase="clr-namespace:xxx.ViewModels.Base;assembly=xxx"
xmlns:markupExtensions="clr-namespace:xxx.ComponentModel.MarkupExtensions;assembly=xxx.forms"
viewModelBase:ViewModelLocator.AutoWireViewModel="true">
<!-- PAGE BEHAVIORS -->
<ContentPage.Behaviors>
<behaviors:EventHandlerBehavior
EventName="Appearing">
<behaviors:ActionCollection>
<behaviors:InvokeCommandAction
Command="{Binding Command}"
CommandParameter="{x:Reference Image}" />
</behaviors:ActionCollection>
</behaviors:EventHandlerBehavior>
</ContentPage.Behaviors>
<!-- PAGE CONTENT -->
<ContentPage.Content>
When I compile in debug I can run the application physically or in the simulator, but when I compile in Release and when I navigate to a page that contains some behavior, my application suddenly crashes and I get:
Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.
Im using : Xamarin.Mac Version: 4.4.1.193 (Visual Studio Community) Xamarin.iOS Version: 11.12.0.4 (Visual Studio Community) Xamarin.Forms Version: 3.0.0.482510
Behaviors.Forms Version: 1.4.0
Any Ideas? I've tried to remove the action collection tag or removing the command and CommandParameter with no success.
Thank you!
Well I have compiled the sample project library and referenced the resulting release dll in my project with the same problem, unexpected crash.
Is so extrange because I updated to .NetStandard2.0.1 the sample and tested on my physical device (iphone8plus) and everything works okay.
I ' dont know wheres the problem ( I suposse is my own problem) but the only trick that has work Is to add all the files from the sample project library to my own project. And Everything now working as always. ...
Hope this can be helpful to anyone who has experienced the same problem. thank you
Same problem here and still can't figure out how to fix it. It seems like behaviors:ActionCollection tag, event empty, is the problem.
Hello @michau33 , try adding all the files from the sample project library to yout own project. It should works, this is the only "solution" that is currently working for me.
Thanks for letting me know. I'll take a look.
@CarLoOSX Trying to reproduce this myself. I can run the GitHub project in a release build on the simulator. Does it only affect builds running in release mode on a device?
Or is it about using the NuGet package in a release build of an app?
Hi, @davidbritch! No, it should not work on the simulator and on real device (I tested on a iphone/ipad but not in android). I also used your project to test, but unfortunately your sample project worked well. I was wondering if the problem could be the .NetStandard version, so I updated your solution to the latest version, but like the previous tests, it worked. After all, I decided to compile your project with the last netstandard version to be able to add it as a reference to my project and after doing this I could not execute any page with your behaviors declared in xaml (I did not try in the code). This reproduced the issue I was having with the last nugget package. It's very strange because adding all your classes / interfaces etc... manually to my project finally worked ... I know this is not too useful, but I do not really understand what's happening ... Sorry for my english ! 👍
I've just created two new projects:
- .NET Standard based Forms app.
- PCL based Forms app.
In both cases I was able to install v1.4 of the Behaviors library, and use it to invoke commands in view models, in both DEBUG and RELEASE modes.
Hopefully this problem is resolved for you now!