xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.59k stars 471 forks source link

Lifecycle events does not work in release mode for Android. #1295

Open kerberosargos opened 3 years ago

kerberosargos commented 3 years ago

Hello, my sample as below. It is working in debug mode but is not working in release mode for Android. Thank you in advance.

<ControlTemplate x:Key="CommonScrollablePageControlTemplate">
    <pcw:PancakeView
        HorizontalOptions="FillAndExpand"
        IsClippedToBounds="True"
        VerticalOptions="FillAndExpand">

        <pcw:PancakeView.Effects>
            <xct:LifecycleEffect Loaded="BodyLayout_Loaded" />
        </pcw:PancakeView.Effects>

    </pcw:PancakeView>
</ControlTemplate>

public void BodyLayout_Loaded(object sender, System.EventArgs e)
{

    ....

}
pictos commented 3 years ago

@kerberosargos Could you attach a small repro?

kerberosargos commented 3 years ago

Hello @pictos my project is very complex. But I have wrote my sample snippet in post.

pictos commented 3 years ago

@kerberosargos I saw it, but since we maintain this project in your free time, isn't that easy to create a project here and try to add your snippet and reproduce the issue. If you can't provide one, it's completely fine but that can take a little bit longer to us to look into it.

Other than that, can you try to add this on your ctor in App.xaml.cs?

_ = new LifecycleEffect();

and let me know if it fixes the issue in release mode.

kerberosargos commented 3 years ago

_ = new LifecycleEffect();

Hello again I have tried as below but it did not work again.

     public App() : this(null) {

            _ = new LifecycleEffect();

        }
maxkoshevoi commented 3 years ago

What is your linker configuration for release and debug modes?

kerberosargos commented 3 years ago

Hello @maxkoshevoi

Release is SDK Assemblies Only

Debug is None

maxkoshevoi commented 3 years ago

Could you set it to SDK assemblies only for Debug and 1) Verify that issue is present in Debug too 2) See if there are any binding failures

jfversluis commented 3 years ago

@kerberosargos is there any specific reason you ignored our bug report template? It would be great if you used it, because it gives us a lot of information to work with instead of having to ask you all these questions separately :)

kerberosargos commented 3 years ago

I am sorry. I am too late for my project. Because of that I did not tried your sdk suggestion. Because I was looking for issuse since one week. After I found, I refactor my codes. Now I am not going back again. If I will find rest time I will try. But I think you can try with this discuss.

16 May 2021 Paz 15:04 tarihinde Gerald Versluis @.***> şunu yazdı:

@kerberosargos https://github.com/kerberosargos is there any specific reason you ignored our bug report template? It would be great if you used it, because it gives us a lot of information to work with instead of having to ask you all these questions separately :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xamarin/XamarinCommunityToolkit/issues/1295#issuecomment-841808102, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWWPUF6GSAWSIR6LO3LA2LTN6YEPANCNFSM445HGXQA .

kerberosargos commented 3 years ago

@pictos Hello again

@kerberosargos is there any specific reason you ignored our bug report template? It would be great if you used it, because it gives us a lot of information to work with instead of having to ask you all these questions separately :)

Hello again.

I have tried yet. Yes it is working in release mode with if link settings is "None" but it is not working with "SDK Assemblies Only" in release mode.

Thank you in advance.

maxkoshevoi commented 3 years ago

Could you set it to SDK assemblies only for Debug and

  1. Verify that issue is present in Debug too
  2. See if there are any binding failures

@kerberosargos Did you have some time to investigate what bindings are failing?

kerberosargos commented 3 years ago

@pictos Hello again

@kerberosargos is there any specific reason you ignored our bug report template? It would be great if you used it, because it gives us a lot of information to work with instead of having to ask you all these questions separately :)

Hello again.

I have tried yet. Yes it is working in release mode with if link settings is "None" but it is not working with "SDK Assemblies Only" in release mode.

Thank you in advance.