Forum Xamarin.Forms

App crash on release mode

When I use '?' operator for a event or listener, on debug mode works fine but when I generate release versión, apps does not work.
When execute this line of code app breaks

event?.Invoque(parameters)

I have to use:

if(event != null)
{
   event.Invoque(parameters)
}

Any idea?

Thanks

Answers

  • igorkr_10igorkr_10 Member ✭✭✭✭

    What is the platform? Android, iOS?

  • nnovalbosnnovalbos Member ✭✭

    Hi @igorkr_10 ,

    thanks for answering. In the core project

  • igorkr_10igorkr_10 Member ✭✭✭✭

    @nnovalbos said:
    Hi @igorkr_10 ,

    thanks for answering. In the core project

    The shared project is library. This cannot be executed. Your application is the android or iOS project + shared library. You need to run Android or iOS project.
    If the problem still exists check your manifest for your Android project

  • nnovalbosnnovalbos Member ✭✭

    I run the Android app and the app starts and shows the first views fine.

    But when I press a button that makes the code I cited earlier run, which is in the shared project, the app closes.

    I think it could be because of the linker or something related to compilation in release mode, since in debug it works fine

  • igorkr_10igorkr_10 Member ✭✭✭✭

    Add AppCenter crash analytics to your project and you will see what causes to crash.

Sign In or Register to comment.