Forum Xamarin.Android

App runs in debug mode, crashes in release mode

2»

Posts

  • LouisBeaumontLouisBeaumont Member ✭✭
    edited July 2018

    My app was perfectly working on both iOS and Android in Debug mode, I tried to use Release mode, now my app is broken (bindings doesn't work anymore), of course i didn't change the code btw.
    I tried all solutions listed above including (tested on Android 7.0 - Samsung G S6 and iOS 10.3.3 - iPhone 5C) =>
    Debug mode

    • ...

    Release mode

    • Turn on / off use shared runtime

    Both mode

    • Try all linking options
    • Enable / disable proguard
    • Add --linkskip=alarm
    • Clean solution + uninstall app from device + rebuild
    • Add / remove internet permission

    I hope someone can help me

  • RJ_11RJ_11 Member ✭✭

    Any solution on this ..?? I am also stuck at same.!!!

  • Waed93Waed93 Member ✭✭

    I am also stuck at same point please if any one can help

  • prishahprishah CAMember ✭✭

    @DFoulk said:
    Just in case the above solutions don't work for someone:

    1. Clean your solution (Debug & Release)
    2. Uninstall the application on your device (or emulator)
    3. Deploy your solution

    These steps (somehow) fixed the crashing for me. No changes were made to anything in my solution- it simply resolved itself after completing the steps above!

    Hope this helps...

    I applied same things that you mentioned , it is working in release mode without changing anything Android project properties. Thanks :)

  • TonyMcCarthyTonyMcCarthy GBUniversity ✭✭

    I am using the latest VS 2017 15.8.9 and am experiencing this problem using API 28.
    The application is uninstalled from the device (pixel 2 running Android 9).
    The application is then run in debug mode on the device. It runs perfectly.
    I then reboot the device and run the application that was uploaded by the debugger.
    It starts to work and then crashes.
    I have tried it with / without shared run time, linking and no linking, AOT compilation or not. It is the same result every time - i.e. it works under debugging and crashes when not being debugged.

    I am having great difficulty in trying to track down why it is crashing. Any advice on how to do this would be greatly appreciated.

    It works perfectly on all devices running API 27 or earlier whether under the debugger or not.

    So I then thought - ok I will set the Compile target API to Oreo instead of Android 9. This appeared to work but created an APK file that has no permissions (the permissions were there, but they were all switched off and you had to go into the settings for the app to turn them on)

    To cut a long story short - this is causing me major grief. I need to get a new release out immediately but I am completely stuck.

  • DimChrisDimChris USMember ✭✭✭✭

    First of all check your permissions. In debug mode as i notice permissions dont force your application to crash, but in release mode they will. Also try to clean and rebuild your project

  • geanyb2712geanyb2712 Member ✭✭

    @Sivamuralidhar said:
    check the internet permission property in Android manifest file.

    This solved my problem. Thanks a bunch

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

    @DFoulk said:
    Just in case the above solutions don't work for someone:

    1. Clean your solution (Debug & Release)
    2. Uninstall the application on your device (or emulator)
    3. Deploy your solution

    These steps (somehow) fixed the crashing for me. No changes were made to anything in my solution- it simply resolved itself after completing the steps above!

    Hope this helps...

    Thank you, It's work for me!

  • DFoulkDFoulk USMember ✭✭✭

    @Liêm_Nguyễn said:

    @DFoulk said:
    Just in case the above solutions don't work for someone:

    1. Clean your solution (Debug & Release)
    2. Uninstall the application on your device (or emulator)
    3. Deploy your solution

    These steps (somehow) fixed the crashing for me. No changes were made to anything in my solution- it simply resolved itself after completing the steps above!

    Hope this helps...

    Thank you, It's work for me!

    Glad to hear it! :)

  • This was also my case: The app was running great in debug, but crashing on release.

    The solution for it was disabling any code shrinker. This (the code shrinkers) seems to have a problem. At first I thought that it was only ProGuard, but also r8 was not working.

    I checked for the other solutions mentioned above, but non of these worked for me. This was the only solution I found.

    Hope this helps,

    Regards.

  • ArmandoClArmandoCl MXMember

    @arturobazil said:
    This was also my case: The app was running great in debug, but crashing on release.

    The solution for it was disabling any code shrinker. This (the code shrinkers) seems to have a problem. At first I thought that it was only ProGuard, but also r8 was not working.

    I checked for the other solutions mentioned above, but non of these worked for me. This was the only solution I found.

    Hope this helps,

    Regards.

    @arturobazil Thanks, it solved my problem.

Sign In or Register to comment.